Additive primes: Difference between revisions
Content deleted Content added
m →{{header|ALGOL W}}: Doh! Range is < 500, not <= 500 |
Thundergnat (talk | contribs) →{{header|Raku}}: Add a Raku example |
||
Line 324: | Line 324: | ||
54 additive primes found: 2 3 5 7 11 23 ... 443 449 461 463 467 487 |
54 additive primes found: 2 3 5 7 11 23 ... 443 449 461 463 467 487 |
||
</pre> |
</pre> |
||
=={{header|Raku}}== |
|||
<lang perl6>unit sub MAIN ($limit = 500); |
|||
say "{+$_} additive primes < $limit:\n{$_».fmt("%" ~ $limit.chars ~ "d").batch(10).join("\n")}", |
|||
with ^$limit .grep: { .is-prime and .comb.sum.is-prime }</lang> |
|||
{{out}} |
|||
<pre>54 additive primes < 500: |
|||
2 3 5 7 11 23 29 41 43 47 |
|||
61 67 83 89 101 113 131 137 139 151 |
|||
157 173 179 191 193 197 199 223 227 229 |
|||
241 263 269 281 283 311 313 317 331 337 |
|||
353 359 373 379 397 401 409 421 443 449 |
|||
461 463 467 487</pre> |
|||
=={{header|REXX}}== |
=={{header|REXX}}== |