Pierpont primes: Difference between revisions
→{{header|ALGOL 68}}
(→{{header|jq}}: one too many debug statements) |
|||
Line 31:
=={{header|ALGOL 68}}==
As in the second Go sample, generates the 3-smooth number sequence to find Pierpoint Prime candidates. Uses a sliding window on the sequence to avoid having to keep it all in memory.
{{libheader|ALGOL 68-primes}}
<lang algol68>BEGIN # find some pierpoint primes of the first kind (2^u3^v + 1) #
# and second kind (2^u3^v - 1) #
# construct a sieve of primes up to 10 000 #
PR read "primes.incl.a68" PR
# returns the minimum of a and b #
PROC min = ( INT a, b )INT: IF a < b THEN a ELSE b FI;
|