This commit is contained in:
David Doblas Jiménez
2021-10-27 11:27:14 +02:00
parent 846a9343ae
commit d9c96f32cf
51 changed files with 315 additions and 366 deletions

View File

@@ -5,23 +5,22 @@ Created on 03 Jul 2021
@email: daviddoji@pm.me
Solution for Problem 10 of Project Euler
https://projecteuler.net/problem=10
=#
https://projecteuler.net/problem=10 =#
using BenchmarkTools
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.
=#
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("Time to evaluate Problem $(lpad(10, 3, "0")):")
@btime Problem10()
println("")
println("Result for Problem 10: ", Problem10())
println("Result for Problem $(lpad(10, 3, "0")): ", Problem10())