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

11 lines
90 B
Python
Raw Normal View History

2021-10-29 00:00:43 +00:00
n = 600851475143
i = 2
while i * i <= n:
if n % i:
i += 1
else:
n //= i
print(n)