Add julia solution and fasten bash solution for problem 10 #1
1 changed files with 14 additions and 0 deletions
14
e0010/euler0010.jl
Normal file
14
e0010/euler0010.jl
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/julia
|
||||||
|
import Primes
|
||||||
|
function sumprimes(n::Int)
|
||||||
|
#primnumbers = SharedArray{Int}(n)
|
||||||
|
primesum=2
|
||||||
|
parasum += @parallel (+) for i in 3:2:n
|
||||||
|
Primes.isprime(i)*i
|
||||||
|
end
|
||||||
|
primesum
|
||||||
|
end
|
||||||
|
sumprimes(11)
|
||||||
|
print(2)
|
||||||
|
@time prime = sumprimes(7)
|
||||||
|
print(prime)
|
Reference in a new issue