Given a positive integer n output the integers a and b (forming reduced fraction a/b) such that:
Where pk is the k th prime number (with p1 = 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\$ – Adnan Mar 23 '16 at 16:00a
andb
as a rational type? \$\endgroup\$ – Alex A. Mar 24 '16 at 0:31