The Fermat numbers are generated by the formula, for n = 0, 1, 2, ...
The first five Fermat numbers 3, 5, 17, 257 and 65537 are all prime. However, when n = 5,
F5 = 232 + 1 = 4294967297 = 641 × 6700417
is composite.
Euler saw that the formula n2 − n + 41 generates primes for n = 1, 2, 3, ... , 40. Clearly, the formula fails to generate a prime when n = 41.