Special neighbor primes: Difference between revisions

Content added Content deleted
(→‎{{header|ALGOL 68}}: Use ALGOL 68-primes)
Line 13: Line 13:
# sieve the primes to max prime * 2 #
# sieve the primes to max prime * 2 #
PR read "primes.incl.a68" PR
PR read "primes.incl.a68" PR
[]BOOL prime ( max prime * 2 );
[]BOOL prime = PRIMESIEVE ( max prime * 2 );
# count the primes up to max prime #
# count the primes up to max prime #
INT p count := 0; FOR i TO max prime DO IF prime[ i ] THEN p count +:= 1 FI OD;
INT p count := 0; FOR i TO max prime DO IF prime[ i ] THEN p count +:= 1 FI OD;