euler/python/e014.py

10 lines
217 B
Python
Raw Normal View History

2019-07-15 05:58:22 +02:00
from lib_misc import collatz_sequence_length
def euler_014():
return max([(collatz_sequence_length(n), n) for n in range(1, 1000000)])[1]
assert(euler_014() == 837799)
print("e014.py: {}".format(euler_014()))