Primes whose sum of digits is 25: Difference between revisions
Content added Content deleted
Recombinant (talk | contribs) (Add Zig solution) |
(add RPL) |
||
Line 2,123: | Line 2,123: | ||
time = 30 mins |
time = 30 mins |
||
done... |
done... |
||
</pre> |
|||
=={{header|RPL}}== |
|||
<code>∑DIGITS</code> is defined at [[Sum digits of an integer#RPL|Sum digits of an integer]] |
|||
≪ { } 799 <span style="color:grey">@ 799 is the smallest integer whose digits sum equals 25, and is not prime : 799 = 47 * 17</span> |
|||
'''DO''' |
|||
NEXTPRIME |
|||
IF DUP <span style="color:blue">∑DIGITS</span> 25 == '''THEN''' SWAP OVER + SWAP '''END''' |
|||
'''UNTIL''' DUP 5000 > '''END''' |
|||
DROP |
|||
≫ '<span style="color:blue">TASK</span>' STO |
|||
{{out}} |
|||
<pre> |
|||
1: {997 1699 1789 1879 1987 2689 2797 2887 3499 3697 3769 3877 3967 4597 4759 4957 4993} |
|||
</pre> |
</pre> |
||