Duffinian numbers: Difference between revisions
Content added Content deleted
(Added Algol 68) |
m (→{{header|ALGOL 68}}: notes and comments) |
||
Line 37: | Line 37: | ||
=={{header|ALGOL 68}}== |
=={{header|ALGOL 68}}== |
||
Constructs a table of divisor counts without doing any divisions. |
|||
<lang algol68>BEGIN # find Duffinian numbers: non-primes relatively prime to their divisor count # |
<lang algol68>BEGIN # find Duffinian numbers: non-primes relatively prime to their divisor count # |
||
INT max number := 500 000; # largest number we will consider # |
INT max number := 500 000; # largest number we will consider # |
||
Line 62: | Line 63: | ||
OR gcd( n, nds ) /= 1 |
OR gcd( n, nds ) /= 1 |
||
THEN |
THEN |
||
# n is prime or is |
# n is prime or is not is relatively prime to its divisor sum # |
||
ds[ n ] := 0 |
ds[ n ] := 0 |
||
FI |
FI |