ExplorationsFermat conjectured from five cases, and the sixth case answered him
Five Primes and Then Never Again
Take 2, square it, square the result, and keep squaring: 2, 4, 16, 256, 65,536. Adding one to each gives the Fermat numbers 3, 5, 17, 257 and 65,537, and every one of those five is prime. 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 conjecture 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.
- F02^1 + 1 = 3prime3 is small enough that there is nothing between 1 and itself to divide by.
- F12^2 + 1 = 5primeEvery divisor up to 2 was tried and none of them went in, which settles 5 completely.
- F22^4 + 1 = 17primeEvery divisor up to 4 was tried and none of them went in, which settles 17 completely.
- 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
| Index | The number | Digits | Prime | How it is established here |
|---|---|---|---|---|
| F0 | 3 | 1 | yes | trial division in this browser |
| F1 | 5 | 1 | yes | trial division in this browser |
| F2 | 17 | 2 | yes | trial division in this browser |
| F3 | 257 | 3 | yes | trial division in this browser |
- 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
Try this
For F5 the search steps by 128 rather than testing every odd number below 65,536. Why is 128 the step?
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.
- 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 prime factor of F5 is allowed to take.
- 4,294,967,2974,294,967,297 ÷ 257 = 16,711,935 remainder 2257 is not a factor257 = 2 × 2^7 + 1, and it is prime, which still does not make it a divisor.
- 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 composite.
- 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.
- 4,294,967,2974,294,967,297 ÷ 641 = 6,700,417 remainder 0641 × 6,700,417641 = 5 × 2^7 + 1. The remainder is zero, so F5 is composite and the streak of five is all there was.
What you are seeing
Square the power of two, 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 power of two. Add one to each of those and you have the Fermat numbers , , , , and .
The streak view gives each of them a verdict by dividing. To decide that 257 is prime, the laboratory divides it by every whole number from 2 up to 16, because a divisor larger than the square root 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.
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 prime, 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 proofs about five numbers, and the conjecture they suggested is a statement about infinitely many.
is 4,294,967,297. Testing every odd number up to its square root means about thirty thousand divisions, which is why the sixth case was out of reach for a long time.
The way in is a theorem about what a factor can look like. Any prime 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 theorem, 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.
Formal statement
What the numbers are, and what is proved about them
The Fermat numbers are
They satisfy , from which any two of them are coprime: a common divisor of and with would divide both and , hence divide 2, and every Fermat number is odd.
through are prime. . Every prime factor of for has the form . Every for is known to be composite, which is a result of other people's computation rather than of anything on this page. Whether any Fermat number beyond is prime is unknown.
Proof
Two arguments, at two different sizes
The first five verdicts are proved by exhaustion, and the exhaustion is genuine. To settle whether is prime, it is enough to test the divisors up to . The laboratory tests all of them. Every possible case is covered, so the check is a proof 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 proof. , and induction from gives the full product. Coprimality follows as above, and it yields a proof that there are infinitely many primes: each Fermat number contributes a prime factor that no earlier one has.
The Lucas form is cited rather than proved here. The shape of the argument is that if a prime divides then 2 has order modulo , so divides ; the extra factor of two in the sharper form comes from 2 being a quadratic residue modulo when .
Limits and further questions
A ruler, a compass, and a question nobody has settled
Gauss found the reason these particular primes matter beyond their own list. A regular polygon with an odd number of sides can be constructed with ruler and compass exactly when that number is a product of distinct Fermat primes. 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 Fermat prime beyond has been found, and every index from 5 to 32 has been shown composite. 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 factor is known, indexes shown composite with no factor in hand, and indexes about which nothing is known at all.
The counting heuristic suggests the five known Fermat primes are all of them, and a heuristic is not a proof in either direction. It is not known whether infinitely many Fermat numbers are composite 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.
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
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
- Sources
- Observationes de theoremate quodam Fermatiano aliisque ad numeros primos spectantibus citation unresolved
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
- Sources
- Theorie des fonctions numeriques simplement periodiques citation unresolved; Observationes de theoremate quodam Fermatiano aliisque ad numeros primos spectantibus citation unresolved
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
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.
- 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.
- 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.
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.
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.
- 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.
Related by mechanism
Connected by how they work, not by sharing a topic label.