Summarize primes: Difference between revisions
Content deleted Content added
Thundergnat (talk | contribs) →{{header|Raku}}: Add a Raku example |
Thundergnat (talk | contribs) m →{{header|Raku}}: fix off-by-one error |
||
Line 41:
<lang perl6>my @primesums = ([\+] grep *.is-prime, ^Inf)[^1000];
say "Of the first {+@primesums} primes:";
printf "The sum of the first %*d is prime: %d\n", @primesums.end.chars, 1 + $_, @primesums[$_]
for grep { @primesums[$_].is-prime }, ^+@primesums;</lang>
{{out}}
<pre>Of the first 1000 primes:
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
The sum of the first
=={{header|Ring}}==
|