MathomalyA field guide to patterns, proofs and open questions

ExplorationsFermat conjectured from five cases, and the sixth case answered him

Five Primes and Then Never Again

Open problemprimesfactorisationconjectureintermediate

Take 2, square it, square the result, and keep squaring: 2, 4, 16, 256, 65,536. Adding one to each gives the 3, 5, 17, 257 and 65,537, and every one of those five is . Fermat conjectured that each number built this way is prime. The next one, F5 = 4,294,967,297, is 641 × 6,700,417, so the is false, and whether any Fermat prime beyond those five exists is still unknown.

Interactive laboratory

Current view: The streak

Watch each Fermat number get a primality verdict, recomputed rather than recited.

The streak · F3
  1. F02^1 + 1 = 3prime3 is small enough that there is nothing between 1 and itself to divide by.
  2. F12^2 + 1 = 5primeEvery divisor up to 2 was tried and none of them went in, which settles 5 completely.
  3. F22^4 + 1 = 17primeEvery divisor up to 4 was tried and none of them went in, which settles 17 completely.
  4. F32^8 + 1 = 257primeEvery divisor up to 16 was tried and none of them went in, which settles 257 completely.

Every verdict here was recomputed by dividing, not looked up. The streak so far is what Fermat had in front of him. Step once more to see whether it continues.

Every rung, as a table
Each Fermat number, how many digits it has, the verdict on it and how that verdict was established
IndexThe numberDigitsPrimeHow it is established here
F031yestrial division in this browser
F151yestrial division in this browser
F2172yestrial division in this browser
F32573yestrial division in this browser
Play the figure
a rung
one Fermat number, printed when it fits and measured in digits when it does not
a prime verdict
the result of dividing that number by every possible divisor up to its square root
the break
the first rung with a divisor, which is where the conjectured pattern ends
not decided here
a rung too large for this method, whose standing is cited rather than computed

One rung per index, smallest at the top. A rung prints the number when it fits, and its verdict comes from dividing by every possible divisor up to the square root of that number. Above F5 the laboratory refuses: those numbers are too large for this method, and the rung says what is known about them and who established it.

Every one of the 4 rungs so far came back prime, each by dividing rather than by citation. Every divisor up to 16 was tried and none of them went in, which settles 257 completely.

Rungs
4
Prime so far
4
Decided here
4
How this page is laid out

Make a prediction

numbers

Change the assumption

What this assumes
Every number of the form 2^(2^n) + 1 is prime.
What breaks it
n = 5. The number is 4,294,967,297, and it has a prime factor that a short search finds.
Where it holds

n = 0, 1, 2, 3 and 4: the numbers 3, 5, 17, 257 and 65,537.

How far up the ladder

Four numbers, every digit printed, and F4 one step away.

Step by step

Run, Step and Reset are under the figure. Run walks the rungs again at this speed.

Speed
Advanced parameters

Cases worth seeing

Try this

For F5 the search steps by 128 rather than testing every odd number below 65,536. Why is 128 the step?

1/2

What is going on

Each explanation begins with a worked example and follows the same operation through intuition, formal statements and proofs. Later sections distinguish what is established from questions that remain open, so you can follow the level of detail useful to you.

Worked by handDividing 4,294,967,297 by each candidate the Lucas form allows, until the fifth one comes out even.
  1. 4,294,967,2974,294,967,297 ÷ 129 = 33,294,320 remainder 17129 is not a factor129 = 1 × 2^7 + 1, the first shape a of F5 is allowed to take.
  2. 4,294,967,2974,294,967,297 ÷ 257 = 16,711,935 remainder 2257 is not a factor257 = 2 × 2^7 + 1, and it is , which still does not make it a .
  3. 4,294,967,2974,294,967,297 ÷ 385 = 11,155,759 remainder 82385 is not a factor385 = 3 × 2^7 + 1 = 5 × 7 × 11, tested rather than skipped for being .
  4. 4,294,967,2974,294,967,297 ÷ 513 = 8,372,255 remainder 482513 is not a factor513 = 4 × 2^7 + 1, the last candidate before the one that works.
  5. 4,294,967,2974,294,967,297 ÷ 641 = 6,700,417 remainder 0641 × 6,700,417641 = 5 × 2^7 + 1. The is zero, so F5 is and the streak of five is all there was.
The hunt in the laboratory prints these same five divisions, one row per candidate, with the each one leaves.
Only five divisions were needed, and only because a says a of this number has to be one more than a multiple of 128. Without it the same search is a march through thousands of odd numbers.
01

What you are seeing

Square the , then add one

Start with 2. Square it to get 4, square that to get 16, then 256, then 65,536, and so on: each step squares the previous . Add one to each of those and you have the , , , , and .

The streak view gives each of them a verdict by dividing. To decide that 257 is , the laboratory divides it by every whole number from 2 up to 16, because a larger than the would have to be paired with a smaller one. Nothing is left over in any of those divisions, so 257 has no divisor except 1 and itself.

02

Why it starts to make sense

Five results in a row are a persuasive thing to see

Three, five, seventeen, 257 and 65,537 are all , and they are the first five cases of a rule that generates numbers with no obvious reason to be prime at all. Fermat looked at that run and conjectured that every number of this form is prime.

It is worth sitting with how reasonable that is. Five consecutive confirmations, no near miss, and the next case already too large to divide by hand. The mistake is not in the arithmetic, which is correct, but in what a finite run of cases is allowed to establish. This page separates the two: the five verdicts on the ladder are about five numbers, and the they suggested is a statement about infinitely many.

03

The key idea

A about the shape of a makes the search short

is 4,294,967,297. Testing every odd number up to its means about thirty thousand divisions, which is why the sixth case was out of reach for a long time.

The way in is a about what a can look like. Any that divides , for , is one more than a multiple of . For that multiple is 128, so the only candidates are 129, 257, 385, 513, 641, and so on. The fifth of them divides. That is the whole factor hunt: five divisions instead of thirty thousand, and the reason the view can show every one of them.

Euler had the weaker version of this , with in place of , which gives twice as many candidates and still finds 641. The sharper form is Lucas's, and it is the one the laboratory uses.

04

Formal statement

What the numbers are, and what is proved about them

The are

They satisfy , from which any two of them are : a common of and with would divide both and , hence divide 2, and every is odd.

through are . . Every prime of for has the form . Every for is known to be , which is a result of other people's computation rather than of anything on this page. Whether any beyond is prime is unknown.

05

Proof

Two arguments, at two different sizes

The first five verdicts are proved by exhaustion, and the exhaustion is genuine. To settle whether is , it is enough to test the up to . The laboratory tests all of them. Every possible case is covered, so the check is a of that one statement. This is the situation in which a finite computation really does prove something, and it is worth naming, because the same laboratory refuses the same verdict two rungs later.

The product identity has a two-line . , and from gives the full product. Coprimality follows as above, and it yields a proof that there are infinitely many : each contributes a prime that no earlier one has.

The Lucas form is cited rather than proved here. The shape of the argument is that if a divides then 2 has order , so divides ; the extra of two in the sharper form comes from 2 being a modulo when .

06

Limits and further questions

A ruler, a compass, and a question nobody has settled

Gauss found the reason these particular matter beyond their own list. A with an odd number of sides can be constructed with ruler and compass exactly when that number is a product of distinct . Three, five, 17, 257 and 65,537 sides are all constructible, and so is a 15-gon, since . A regular 7-gon is not. Gauss found the 17-gon construction at nineteen, and the discovery is what turned him to mathematics. So the list of Fermat primes is also the list of odd prime numbers of sides a Greek geometer could have drawn, and it is a list nobody knows the end of.

What is known now: no beyond has been found, and every index from 5 to 32 has been shown . The frontier in the growth view is that result, and it belongs to the people who computed it, not to this page. Beyond it the status table records indexes where a is known, indexes shown composite with no factor in hand, and indexes about which nothing is known at all.

The counting suggests the five known are all of them, and a heuristic is not a in either direction. It is not known whether infinitely many Fermat numbers are either. A rule this simple, with an answer known for five of its cases and unknown for the rest of them, is the ordinary condition of the subject rather than an unusual one.

What is actually established

Every statement on this page, with its status, its exact scope, and the date that status was last checked.

Proved

F0, F1, F2, F3 and F4, which are 3, 5, 17, 257 and 65,537, are prime.

Scope
Those five numbers and no others. Each verdict is recomputed in the browser by dividing by every possible divisor up to its square root.
Why
For one fixed number the list of possible divisors is finite, and the laboratory tries all of it. A finite check that covers every case is a complete proof of the statement it covers, which here is a statement about five particular numbers. It says nothing whatever about F5 or any later index.
Status checked
Proved

F5 = 4,294,967,297 = 641 × 6,700,417, so it is not prime.

Scope
The single number F5. The laboratory finds 641 by division and multiplies the two factors back together; the tests do the same.
Why
Euler reported the factor 641, which is what ended the conjecture. A factorisation is checked by multiplying, so nothing here rests on the citation: 641 × 6,700,417 is computed exactly and compared with 2^32 + 1.
Status checked
Proved

Every prime factor of F_n for n at least 2 has the form k × 2^(n+2) + 1 for some positive whole number k.

Scope
All indexes n at least 2. The theorem is cited, not proved on this page; the laboratory uses it to decide which candidates to divide by.
Why
Euler proved the weaker statement with exponent n+1, which is what made his search for a factor of F5 finite. Lucas sharpened it to n+2, halving the number of candidates, and that sharper form is the one the search view marches through. The page uses the Lucas form and says so rather than attributing it to Euler.
Status checked
Proved

No Fermat number F_n with n from 5 to 32 is prime.

Scope
Indexes 5 to 32, as of the cited status page. Established by other people over decades of computation, much of it distributed; this page computes only F5 and F6 and cites the rest.
Why
The status table records, for each index, whether a factor is known or the number has been shown composite without one. This is a proved statement in the literature rather than a search this laboratory runs, and the range it covers moves as the table is updated. Nothing in it is offered as a local exhaustive check.
Status checked
Sources
Fermat factoring status citation unresolved
Open problem

Whether any Fermat number beyond F4 is prime is unknown.

Scope
All indexes above 4. No proof that the five known Fermat primes are all of them, and no sixth example, is known.
Why
Heuristic arguments about how often numbers of this size are prime suggest that no further Fermat prime exists, and they are heuristics rather than proofs. The question of whether infinitely many Fermat numbers are composite is also open.
Status checked
Sources
Unsolved Problems in Number Theory citation unresolved; A019434: Fermat primes citation unresolved

Sources

Review notes show which bibliographic details Mathomaly has checked and which remain unresolved. Checking a publication record does not independently verify its proof.

  1. Leonhard Euler, Observationes de theoremate quodam Fermatiano aliisque ad numeros primos spectantibus, Commentarii academiae scientiarum Petropolitanae 6, 1738. Link

    The paper in which Euler reports that 641 divides F5. The factorisation itself is recomputed on this page rather than taken from the citation.

    Citation details remain unresolved after review by Mathomaly.

    Bibliographic review:

    AI-assisted bibliographic audit. Evidence type: unresolved.

    The Euler Archive record for E26 could not be retrieved during the audit, so the bibliographic identity of this paper is unconfirmed here.

  2. Edouard Lucas, Theorie des fonctions numeriques simplement periodiques, American Journal of Mathematics 1, 1878. Link

    The source for the sharper k·2^(n+2) + 1 form of a prime factor of F_n, which Euler had established with exponent n+1. The page uses the sharper form and says whose it is.

    Citation details remain unresolved after review by Mathomaly.

    Bibliographic review:

    AI-assisted bibliographic audit. Evidence type: unresolved.

    The journal record could not be retrieved during the audit, so the volume, pagination and attribution of the sharpened form are unconfirmed here.

  3. Wilfrid Keller, Fermat factoring status, prothsearch.com. Link

    The maintained status table of what is known about each Fermat number: which are factored, which are known composite without a known factor, and which are undecided. Everything this page says about indexes above 6 comes from here and was computed by other people.

    Citation details remain unresolved after review by Mathomaly.

    Bibliographic review:

    AI-assisted bibliographic audit. Evidence type: unresolved.

    The status page could not be retrieved during the audit, so the range it currently covers is cited as of its own stated status rather than confirmed here.

  4. Richard K. Guy, Unsolved Problems in Number Theory, Springer, third edition, problem A3, 2004. Link

    Problem A3 states the open question: whether any Fermat number beyond F4 is prime, and whether only finitely many are composite.

    Citation details remain unresolved after review by Mathomaly.

    Bibliographic review:

    AI-assisted bibliographic audit. Evidence type: unresolved.

    The publisher record could not be retrieved during the audit, so the edition and problem number are unconfirmed here.

  5. A019434: Fermat primes, The On-Line Encyclopedia of Integer Sequences. Link

    The sequence of known Fermat primes, which has five terms and is not known to be complete.

    Citation details remain unresolved after review by Mathomaly.

    Bibliographic review:

    AI-assisted bibliographic audit. Evidence type: unresolved.

    The OEIS entry returned an authentication error during the audit, so its terms and comments are unconfirmed here.

Connected by how they work, not by sharing a topic label.