This commit is contained in:
David Doblas Jiménez
2021-09-20 18:08:16 +02:00
parent 2a1db7eda3
commit 86aff084d8
49 changed files with 2254 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
#=
Created on 15 Jun 2021
@author: David Doblas Jiménez
@email: daviddoji@pm.me
Solution for Problem 3 of Project Euler
https://projecteuler.net/problem=3
=#
function Problem3()
#=
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
=#
ans = 600_851_475_143
factor = 2
while factor * factor < ans
while ans % factor == 0
ans = ans ÷ factor
end
factor += 1
end
return ans
end
println("Time to evaluate Problem 3:")
@time Problem3()
println("")
println("Result for Problem 3: ", Problem3())