这激起了我的兴趣,因为我试图找到一个更大的质数,但是我很快意识到,当我尝试将2400万个数字(2 ^ 82,589,933 − 1)插入数字时,我的编程语言的解释器很快弹出错误。一个变量。所以我想知道,研究人员如何做到这一点?当存在明显的计算限制时,它们如何处理找到这么大的数字的过程?
for x in range(2,100000):
if pow(65537,2**x-2, 2**x-1) == 1:
print(f"2**{x}-1 is prime")
2**2-1 is prime
2**3-1 is prime
2**5-1 is prime
2**7-1 is prime
2**13-1 is prime
2**17-1 is prime
2**19-1 is prime
2**31-1 is prime
2**61-1 is prime
2**89-1 is prime
2**107-1 is prime
2**127-1 is prime
2**521-1 is prime
2**607-1 is prime
2**1279-1 is prime
2**2203-1 is prime
2**2281-1 is prime
2**3217-1 is prime
2**4253-1 is prime
2**4423-1 is prime