Primes whose sum of digits is 25: Difference between revisions
Content added Content deleted
No edit summary |
Thundergnat (talk | contribs) (→{{header|Raku}}: Add a Raku example) |
||
Line 96: | Line 96: | ||
"1 minute and 27s" |
"1 minute and 27s" |
||
</pre> |
</pre> |
||
=={{header|Raku}}== |
|||
<lang perl6>unit sub MAIN ($limit = 5000); |
|||
say "{+$_} primes < $limit with digital sum 25:\n{$_».fmt("%" ~ $limit.chars ~ "d").batch(10).join("\n")}", |
|||
with ^$limit .grep: { .is-prime and .comb.sum == 25 }</lang> |
|||
{{out}} |
|||
<pre>17 primes < 5000 with digital sum 25: |
|||
997 1699 1789 1879 1987 2689 2797 2887 3499 3697 |
|||
3769 3877 3967 4597 4759 4957 4993</pre> |
|||
=={{header|Ring}}== |
=={{header|Ring}}== |