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,8 +5,7 @@ Created on 20 Sep 2021
@email: daviddoji@pm.me
Solution for Problem 50 of Project Euler
https://projecteuler.net/problem=50
=#
https://projecteuler.net/problem=50 =#
using BenchmarkTools
using Primes
@@ -19,11 +18,10 @@ function Problem50()
This is the longest sum of consecutive primes that adds to a prime below one-hundred.
The longest sum of consecutive primes below one-thousand that adds to a prime,
The longest sum of consecutive primes below one-thousand that adds to a prime,
contains 21 terms, and is equal to 953.
Which prime, below one-million, can be written as the sum of the most consecutive primes?
=#
Which prime, below one-million, can be written as the sum of the most consecutive primes? =#
ans = 0
result = 0
@@ -48,7 +46,7 @@ function Problem50()
end
println("Time to evaluate Problem 50:")
println("Time to evaluate Problem $(lpad(50, 3, "0")):")
@btime Problem50()
println("")
println("Result for Problem 50: ", Problem50())
println("Result for Problem $(lpad(50, 3, "0")): ", Problem50())