Factorial primes: Difference between revisions
Content added Content deleted
(→{{header|Wren}}: More efficient basic version.) |
(→{{header|ALGOL 68}}: Tweak again) |
||
Line 30:
=={{header|ALGOL 68}}==
Basic task. Assumes LONG INT is at least 64 bits.
<lang algol68>BEGIN # find some factorial primes - primes that are f - 1 or f + 1 #
#
# is prime PROC based on the one in the primality by trial division task #
Line 42:
prime
FI;
# end of code
PROC show factorial prime = ( INT fp number, INT n, CHAR fp op, LONG INT fp )VOID:
Line 51:
);
LONG INT f := 1;
INT
FOR n WHILE fp count < 10 DO
f *:= n;
IF LONG INT fp
THEN
show factorial prime( fp count +:= 1
FI;
IF LONG INT fp
THEN
show factorial prime( fp count +:= 1
FI
OD
|