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 ? What is the largest prime factor of the number 600851475143 ?
""" """
target = 600851475143 ans = 600851475143
ans = 2 factor = 2
while ans * ans < target: while factor * factor < ans:
while target % ans == 0: while ans % factor == 0:
target = target // ans ans = ans // factor
ans += 1 factor += 1
return target return ans
if __name__ == "__main__": if __name__ == "__main__":