Solution to problem 10 in Julia
This commit is contained in:
parent
041066da0e
commit
d973833082
27
src/Julia/Problem010.jl
Normal file
27
src/Julia/Problem010.jl
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#=
|
||||||
|
Created on 03 Jul 2021
|
||||||
|
|
||||||
|
@author: David Doblas Jiménez
|
||||||
|
@email: daviddoji@pm.me
|
||||||
|
|
||||||
|
Solution for Problem 10 of Project Euler
|
||||||
|
https://projecteuler.net/problem=10
|
||||||
|
=#
|
||||||
|
|
||||||
|
using Primes
|
||||||
|
|
||||||
|
function Problem10()
|
||||||
|
#=
|
||||||
|
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
|
||||||
|
|
||||||
|
Find the sum of all the primes below two million.
|
||||||
|
=#
|
||||||
|
|
||||||
|
return sum(primes(1_999_999))
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
println("Time to evaluate Problem 10:")
|
||||||
|
@time Problem10()
|
||||||
|
println("")
|
||||||
|
println("Result for Problem 10: ", Problem10())
|
Loading…
x
Reference in New Issue
Block a user