if __name__ == '__main__':
    p = 44497
start = time.time()
result1 = mersenne1(p)
print('Elapsed time: {:6.3f}'.format(time.time() - start))
start = time.time()
result2 = mersenne2(p)
print('Elapsed time: {:6.3f}'.format(time.time() - start))
start = time.time()
result3 = mersenne3(p)
print('Elapsed time: {:6.3f}'.format(time.time() - start))
if result1 == result2 == result3:
    print('All three tests are equal!')
else:
    print('Oops, something has gone wrong.')
Trying to calculate large numbers in Python with gmpy. Python keeps crashing?