Solve problem 97
This commit is contained in:
16
python/e097.py
Normal file
16
python/e097.py
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user