Consistency formatting

This commit is contained in:
David Doblas Jiménez 2021-06-05 15:08:54 +02:00
parent 5c7cec373c
commit da28ecdd09

View File

@ -19,14 +19,14 @@ def compute():
What is the largest prime factor of the number 600851475143 ?
"""
target = 600851475143
ans = 2
while ans * ans < target:
while target % ans == 0:
target = target // ans
ans += 1
ans = 600851475143
factor = 2
while factor * factor < ans:
while ans % factor == 0:
ans = ans // factor
factor += 1
return target
return ans
if __name__ == "__main__":