Primes whose sum of digits is 25: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
(Added Quackery.) |
||
Line 1,938: | Line 1,938: | ||
3967 4597 4759 4957 |
3967 4597 4759 4957 |
||
4993</pre> |
4993</pre> |
||
=={{header|Quackery}}== |
|||
<code>eratosthenes</code> and <code>isprime</code> are defined at [[Sieve of Eratosthenes#Quackery]]. |
|||
<syntaxhighlight lang="Quackery"> 5000 eratosthenes |
|||
[ 0 |
|||
[ over while |
|||
swap 10 /mod |
|||
rot + again ] |
|||
nip ] is digitsum ( n --> n ) |
|||
[] 5000 times |
|||
[ i^ isprime not if done |
|||
i^ digitsum 25 = if |
|||
[ i^ join ] ] |
|||
echo |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre>[ 997 1699 1789 1879 1987 2689 2797 2887 3499 3697 3769 3877 3967 4597 4759 4957 4993 ]</pre> |
|||
=={{header|Raku}}== |
=={{header|Raku}}== |