Automatic commit performed through alias...
This commit is contained in:
@@ -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))
|
||||||
|
|||||||
Reference in New Issue
Block a user