Fermat Primes

Fermat Primes are prime numbers of the form F_{n} = 2^{(2^n)} + 1, where n is a non-negative integer and are named after the French Mathematician Pierre de Fermat who studied numbers of this form.

If 2n + 1 is a prime, then n is a power of 2

For 2n + 1 to be prime, then n must not contain an odd factor, or 2n + 1 would be a factorable number of the form:

 2^n+1=(2^a)^b+1=(2^a+1)[2^(a(b-1))-2^(a(b-2))+2^(a(b-3))-...+1]. However, although this condition is necessary, it is not sufficient. Fermat conjectured that all the numbers of this form would be prime, however in 1732, Leonard Euler showed that F5 is a composite (4,294,967,297 = 641 * 6,700,417). Currently, we only know of 5 prime Fermat Numbers:

Pépin’s Test: Théophile Pépin showed that a Fermat number is prime if and only if:

This condition is both necessary and sufficient.


  • For n ≥ 1,  F_{n} = F_{0} \cdots F_{n-1} + 2\!

This can be proved by induction:

When n = 1: F0 + 2 = 3 + 2 = F1 

Assume: Fn = F0···Fn-1 + 2 is true

Then:    F0···Fn + 2

            = F0···Fn-1· Fn + 2

            = (Fn – 2)·Fn + 2

            = (22^n – 1)(22^n + 1) + 2

            = 22^n+1 + 1 = Fn+1

  • For n ≥ 1,  F_{n} = (F_{n-1}-1)^{2}+1\!

Proof: (Fn-1 -1)2 + 1 = (22^n-1 +1 – 1)+ 1 = 22^n + 1 = Fn

  • No Fermat number is a perfect square. 

F0 and F1 (3 and 5 respectively) are clearly not perfect squares.

For Fn where n ≥ 2, Fn ≡ 7 (mod 10). However, only numbers that are congruent to 0, 1, 4, 5, 6, or 9 (mod 10) can be a perfect square.

  • No two Fermat numbers share a common factor greater that 1.

We will prove this by contradiction. Let’s suppose there exist Fi and Fj (where Fj > Fi) such that there exists an a > 1 that divides both of them. Another property of Fermat numbers that can be shown by induction is:

Screen Shot 2016-03-14 at 1.48.28 PM.png

Hence, Screen Shot 2016-03-14 at 1.49.14 PM.

As Fi divided Fj, a also divides Fj-1 and thus F0···Fi···Fj-1. Then, a has to divide the difference Fj – F0···Fj-1, which equals 2 (as shown in property 1). It follows that a = 2, but all Fermat numbers are odd, therefore there is a contradiction and so no two Fermat numbers share a common factor greater that 1.

I have only covered a few properties satisfied by Fermat Primes, but this article is very comprehensive and lists a wide selection of their properties.

Little is known about Fermat numbers for large n, and in fact the following are all open problems:

  • Is Fn composite for all n > 4? So far no primes have been found for n > 4.
  • Are there infinitely many Fermat primes? 
  • Are there infinitely many composite Fermat numbers?
  • Does a Fermat number exist that is divisible by a perfect square other than 1 i.e. not square-free?


Sources: 1 | 2

Hope you liked this more mathematics heavy post! Let me know what you think. M x



8 thoughts on “Fermat Primes”

  1. I find Fermat primes interesting only since, towards the end of the book Disquisitiones Arithmeticae (“investigations of arithmetic”), Gauss proved that:

    “A regular n-gon can be constructed with compass and straightedge if n is the product of a power of 2 and any number of distinct Fermat primes (including none).”

    I you become “very” interested in Number Theory, try to read Disquisitiones Arithmeticae, following versions are available:
    (1) Original Latin: http://edoc.hu-berlin.de/ebind/hdok2/h284_gauss_1801/pdf/h284_gauss_1801.pdf
    (2) Spanish translation: http://cimm.ucr.ac.cr/da/
    (3) English translation: http://yalebooks.co.uk/display.asp?k=9780300094732

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s