This repository has been archived on 2024-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
project-euler/e0010/euler0010.jl

14 lines
263 B
Julia
Raw Normal View History

2017-08-09 12:41:08 +02:00
#!/usr/bin/julia
import Primes
function sumprimes(n::Int)
#primnumbers = SharedArray{Int}(n)
primesum=2
2017-08-09 12:52:06 +02:00
parasum = @parallel (+) for i in 3:2:n
2017-08-09 12:41:08 +02:00
Primes.isprime(i)*i
end
2017-08-09 12:52:06 +02:00
primesum+=parasum
2017-08-09 12:41:08 +02:00
end
2017-08-09 12:52:06 +02:00
sumprimes(10)
@time prime = sumprimes(2000000)
2017-08-09 12:41:08 +02:00
print(prime)