the-honk/euler/_pythonarchive/3 - Largest prime factor.py

11 lines
90 B
Python
Raw Normal View History

2024-10-09 17:02:34 +00:00
n = 600851475143
i = 2
while i * i <= n:
if n % i:
i += 1
else:
n //= i
print(n)