Proofs of Existence and Optimality · Difficult Problems in Number Theory (Optional)

Lesson 3

Nikolai Chukhin · Alexander S. Kulikov

The code below shows that for \(n=5\) the corresponding number is composite.

from sympy import isprime

for n in range(7):
    f = 2 ** (2 ** n) + 1
    print(n, f, isprime(f))

0 3 True
1 5 True
2 17 True
3 257 True
4 65537 True
5 4294967297 False
6 18446744073709551617 False