Zsigmondy numbers: Difference between revisions

→‎{{header|ALGOL 68}}: Slight optimisation
(→‎{{header|ALGOL 68}}: use a smaller font for the output)
(→‎{{header|ALGOL 68}}: Slight optimisation)
 
(2 intermediate revisions by the same user not shown)
Line 54:
 
=={{header|ALGOL 68}}==
64-bit integers are needed to show some of the "larger" a, b values, adjust the INTEGER mode and isqrt procedure accordingly, if necessary for your compiler/interpreter.
<syntaxhighlight lang="algol68">
BEGIN # find some Zsigmondy numbers #
Line 104 ⟶ 105:
INTEGER d := 1;
INTEGER max d := isqrt( an minus bn );
WHILE ( d +:= 1 ) <= max d AND largest divisor <= max d DO
IF an minus bn MOD d = 0 THEN
# d is a divisor of a^n - b^n #
3,044

edits