structural:expansion, structural:scholar_edition, information:classification, linguistic:voice_change
Primality

Fermat numbers and Fermat primes were first studied by Pierre de Fermat, who conjectured that all Fermat numbers are prime. Indeed, the first five Fermat numbers F,..., F are easily shown to be prime. Fermat's conjecture was refuted by Leonhard Euler in 1732 when he showed that

Euler proved that every factor of F must have the form k 2 + 1 (later improved to k 2 + 1 by Lucas) for n ≥ 2.

That 641 is a factor of F can be deduced from the equalities 641 = 2 × 5 + 1 and 641 = 2 + 5. It follows from the first equality that 2 × 5 ≡ −1 (mod 641) and therefore (raising to the fourth power) that 2 × 5 ≡ 1 (mod 641). On the other hand, the second equality implies that 5 ≡ −2 (mod 641). These congruences imply that 2 ≡ −1 (mod 641).

Fermat was probably aware of the form of the factors later proved by Euler, so it seems curious that he failed to follow through on the straightforward calculation to find the factor. One common explanation is that Fermat made a computational mistake.

There are no other known Fermat primes F with n > 4, but little is known about Fermat numbers for large n. In fact, each of the following is an open problem:

As of 2024, it is known that F is composite for 5 ≤ n ≤ 32, although of these, complete factorizations of F are known only for 0 ≤ n ≤ 11, and there are no known prime factors for n = 20 and n = 24. The largest Fermat number known to be composite is F, and its prime factor 7 × 2 + 1 was discovered in October 2020.