Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Summarize-primes/Julia/summarize-primes.julia
Normal file
11
Task/Summarize-primes/Julia/summarize-primes.julia
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
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 $n primes from prime 2 to prime $(p1000[n]) is $sparray, which is prime.")
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue