Giuga numbers: Difference between revisions

→‎{{header|ALGOL 68}}: Further simplicication
(→‎{{header|ALGOL 68}}: Simplify: As suggested by the Wren sample, 4 can't be a factor of a Giuga number (and in general; any prime squared can't be a factor) also assume the first 4 Giuga numbers are even)
(→‎{{header|ALGOL 68}}: Further simplicication)
Line 85:
f count +:= 1;
is giuga := ( ( n OVER f ) - 1 ) MOD f = 0;
IFv isOVERAB giuga THENf
# n is still a candidate #
v OVERAB f;
is giuga := v MOD f /= 0
FI
FI
OD;
3,048

edits