Given a positive integer \$n\$ output the integers \$a\$ and \$b\$ (forming reduced fraction \$a/b\$) such that:
$$\frac a b = \prod ^n _{k=1} \frac {p^2_k - 1} {p^2_k + 1}$$
Where \$p_k\$ is the \$k\$ th prime number (with \$p_1 = 2\$).
Examples:
1 -> 3, 5
2 -> 12, 25
3 -> 144, 325
4 -> 3456, 8125
5 -> 41472, 99125
15 -> 4506715396450638759507001344, 11179755611058498955501765625
420 -> very long
Probabilistic prime checks are allowed, and it's ok if your answer fails due to limitations in your language's integer type.
Shortest code in bytes wins.
3.0
instead of3
? \$\endgroup\$a
andb
as a rational type? \$\endgroup\$