Summarize primes: Difference between revisions

m
no edit summary
m (→‎{{header|Raku}}: commas and count)
mNo edit summary
Line 64:
fmt.Println(c, "such prime sums found")
}</lang>
 
{{out}}
<pre>
Same as Wren example.
</pre>
 
 
=={{header|Julia}}==
<lang julia>using Primes
 
p1000 = primes(1000)
 
for n in 1:length(p1000)
parray = p1000[1:n]
sparray = sum(parray)
if isprime(sparray)
println("The sum of the primes from prime 2 to prime $(p1000[n]) is $sparray, which is prime.")
end
end
</lang>{{out}}
The sum of the primes from prime 2 to prime 2 is 2, which is prime.
The sum of the primes from prime 2 to prime 3 is 5, which is prime.
The sum of the primes from prime 2 to prime 7 is 17, which is prime.
The sum of the primes from prime 2 to prime 13 is 41, which is prime.
The sum of the primes from prime 2 to prime 37 is 197, which is prime.
The sum of the primes from prime 2 to prime 43 is 281, which is prime.
The sum of the primes from prime 2 to prime 281 is 7699, which is prime.
The sum of the primes from prime 2 to prime 311 is 8893, which is prime.
The sum of the primes from prime 2 to prime 503 is 22039, which is prime.
The sum of the primes from prime 2 to prime 541 is 24133, which is prime.
The sum of the primes from prime 2 to prime 557 is 25237, which is prime.
The sum of the primes from prime 2 to prime 593 is 28697, which is prime.
The sum of the primes from prime 2 to prime 619 is 32353, which is prime.
The sum of the primes from prime 2 to prime 673 is 37561, which is prime.
The sum of the primes from prime 2 to prime 683 is 38921, which is prime.
The sum of the primes from prime 2 to prime 733 is 43201, which is prime.
The sum of the primes from prime 2 to prime 743 is 44683, which is prime.
The sum of the primes from prime 2 to prime 839 is 55837, which is prime.
The sum of the primes from prime 2 to prime 881 is 61027, which is prime.
The sum of the primes from prime 2 to prime 929 is 66463, which is prime.
The sum of the primes from prime 2 to prime 953 is 70241, which is prime.
</pre>
 
4,105

edits