Special neighbor primes: Difference between revisions

m
→‎{{header|ALGOL 68}}: Avoid line-wrap
(J)
m (→‎{{header|ALGOL 68}}: Avoid line-wrap)
Line 97:
PR read "primes.incl.a68" PR
INT max prime = 100;
[]BOOL prime = PRIMESIEVE ( max prime * 2 ); # sieve the primes to max prime * 2 #
[]INT low prime = EXTRACTPRIMESUPTO max prime FROMPRIMESIEVE prime; # constructget a list of the primes up to max prime #
# find the adjacent primes p1, p2 such that p1 + p2 - 1 is prime #
FOR i TO UPB low prime - 1 DO
3,030

edits