Primes whose sum of digits is 25: Difference between revisions
→{{header|ALGOL 68}}: Use ALGOL 68-prime
m (→{{header|REXX}}: added the displaying of a foot separtor, added/changed comments, added whitespace, optimized the main DO loop.) |
(→{{header|ALGOL 68}}: Use ALGOL 68-prime) |
||
Line 15:
=={{header|ALGOL 68}}==
<lang algol68>BEGIN # find primes whose digits sum to 25 #
# show all sum25 primes below 5000 #
PR read "primes.incl.a68" PR
[]BOOL prime =
INT p25 count := 0;
FOR n TO
IF prime[ n ] THEN
# have a prime, check for a sum25 prime #
Line 47 ⟶ 35:
FI
OD;
print( ( newline, "Found ", whole( p25 count, 0 ), " sum25 primes below ", whole(
END</lang>
{{out}}
Line 114 ⟶ 102:
END</lang>
{{out}}
Note that ALGOL 68G under Windows is fully interpreted so runtime is not of the same order as the Phix and Go samples
<pre>
There are 1525141 sum25 primes that contain no zeroes
|