euler/python/e097.py

17 lines
314 B
Python
Raw Normal View History

2021-04-19 17:55:37 +02:00
def euler_097():
mod = 10**10 # we want the last ten digits
s = 1
for _ in range(7830457):
s = (s * 2) % mod
s = (28433 * s) % mod
s = s + 1
return s
if __name__ == "__main__":
solution = euler_097()
print("e097.py: " + str(solution))
assert(solution == 8739992577)