Automatic commit performed through alias...

This commit is contained in:
Shaun Setlock
2020-04-17 23:43:43 -04:00
parent 907449046d
commit bd8e8211aa

View File

@@ -11,8 +11,10 @@ import decorators
def treat_evens(n): def treat_evens(n):
mod_is_zero = True mod_is_zero = True
done = True
dividend = 2 dividend = 2
while mod_is_zero: while mod_is_zero or done:
done = dividend == n
num = n/dividend num = n/dividend
mod_is_zero = 0 == n%dividend mod_is_zero = 0 == n%dividend
dividend *= 2 dividend *= 2
@@ -22,7 +24,8 @@ def treat_evens(n):
@decorators.function_timer @decorators.function_timer
def main(): def main():
orig = 600851475143 #orig = 600851475143
orig = 8
num = treat_evens(orig) num = treat_evens(orig)
print("Highest prime of 600851475143 is {}".format(num)) print("Highest prime of 600851475143 is {}".format(num))