Prime reciprocal sum: Difference between revisions
Content added Content deleted
SqrtNegInf (talk | contribs) (Added Perl) |
(→{{header|ALGOL 68}}: Find the first 15) |
||
Line 39: | Line 39: | ||
# previous primes and the sum remain below 1 # |
# previous primes and the sum remain below 1 # |
||
PR precision |
PR precision 5000 PR # set the precision of LONG LONG INT # |
||
PR read "primes.incl.a68" PR # include prime utilities # |
PR read "primes.incl.a68" PR # include prime utilities # |
||
Line 87: | Line 87: | ||
# each succeeding prime is the next prime > the denominator of the sum # |
# each succeeding prime is the next prime > the denominator of the sum # |
||
# divided by the difference of the denominator and the numerator # |
# divided by the difference of the denominator and the numerator # |
||
FOR i FROM 2 TO |
FOR i FROM 2 TO 15 DO |
||
LONG LONG INT next := IF num OF sum + 1 = den OF sum |
LONG LONG INT next := IF num OF sum + 1 = den OF sum |
||
THEN den OF sum + 1 |
THEN den OF sum + 1 |
||
Line 129: | Line 129: | ||
13: 12748246592672078196...20708715953110886963 592 digits |
13: 12748246592672078196...20708715953110886963 592 digits |
||
14: 46749025165138838243...65355869250350888941 1180 digits |
14: 46749025165138838243...65355869250350888941 1180 digits |
||
15: 11390125639471674628...31060548964273180103 2358 digits |
|||
</pre> |
</pre> |
||