Project Euler Problem 3: Largest Prime Factor¶
The source code for this problem can be found here.
Problem Statement¶
The prime factors of \(13195\) are \(5,7,13\) and \(29\).
What is the largest prime factor of the number \(600851475143\)?
Solution Discussion¶
Factor the number \(600851475143\) and then find the largest prime factor.
Solution Implementation¶
from lib.numbertheory import factor
def solve():
""" Compute the answer to Project Euler's problem #3 """
target = 600851475143
factors = factor(target)
answer = max(factors.keys()) # factors = {prime: power}
return answer
expected_answer = 6857

solutions.problem3.
solve
()¶ Compute the answer to Project Euler’s problem #3