Pierre de Fermat wrote to Marin Mersenne on December 25, 1640 that:
If I can determine the basic reason why
3, 5, 17, 257, 65 537, …,
are prime numbers, I feel that I would find very interesting results, for I have already found marvelous things [along these lines] which I will tell you about later. [Archibald1914].
This is usually taken to be the conjecture that every number of the form is prime. So we call these the Fermat numbers, and when a number of this form is prime, we call it a Fermat prime.
The only known Fermat primes are the first five Fermat numbers: F0=3, F1=5, F2=17, F3=257, and F4=65537. A simple heuristic shows that it is likely that these are the only Fermat primes (though many folks like Eisentsein thought otherwise).
In 1732 Euler discovered 641 divides F5. It only takes two trial divisions to find this factor because Euler showed that every divisor of a Fermat number Fn with n greater than 2 has the form k.2n+2+1. In the case of F5 this is 128k+1, so we would try 257 and 641 (129, 385, and 513 are not prime). Now we know that all of the Fermat numbers are composite for the other n less than 31. The quickest way to check a Fermat number for primality (if trial division fails to find a small factor) is to use Pepin’s test.
Gauss proved that a regular polygon of n sides can be inscribed in a circle with Euclidean methods (e.g., by straightedge and compass) if and only if n is a power of two times a product of distinct Fermat primes.
The Fermat numbers are pairwise relatively prime, as can be seen in the following identity:
F0F1F2…..Fn-1 +2 = Fn.
(This gives a simple proof that there are infinitely many primes.)
The quickest way to find out if a Fermat number is prime, is to use Pepin’s test [Pepin77]. It is not yet known if there are infinitely many Fermat primes, but it seems likely that there are not.