Honaker primes: Difference between revisions

m
Line 24:
 
=={{header|ALGOL 68}}==
After experimenting on TIO.RUN, it seems that with ALGOL 68G, calculating the digit sums the "traditional" way is slightly faster than generating a table of digit sums. In the sample below, the digit sum is calculated by first converting the number to a string - this is faster in ALGOL 68G than using MOD and division. For other implementations of Algol 68, using MOD and division may be faster.
<syntaxhighlight lang="algol68">
BEGIN # find some Honaker primes: primes whose digit-sum equals the #
3,049

edits