Legendre's conjecture
Between 1 and 4 lie the primes 2 and 3. Between 4 and 9 lie 5 and 7, between 9 and 16 the numbers 11 and 13, and between 16 and 25 there are even three: 17, 19 and 23. The numbers 1, 4, 9, 16, 25 are squares, that is, 12, 22, 32, 42, 52. Is there a prime between every two consecutive squares, that is, between n2 and (n + 1)2 for every n? That is Legendre’s conjecture, and nobody knows the answer. Computers have checked it up to numbers with 28 digits, but there is no proof. And as we will see, not even the famous Riemann hypothesis would help if someone proved it.
The conjecture is named after the French mathematician Adrien-Marie Legendre (1752–1833). It is attributed to him and is usually linked with his book on number theory (2nd edition 1808). It was made famous by Edmund Landau, who in 1912 included it among four famous open problems about primes, alongside Goldbach’s conjecture and twin primes.
A staircase of squares
Let’s write the numbers in columns so that each column starts at the bottom with one square and ends at the top with the next square. So the last number of a column is also the first number of the next column. Squares are in blue, primes in red, and above each column is the number of primes in it:
The columns grow like a staircase. The distance between n2 and (n + 1)2 is
so each column is two cells taller than the one before. Not a single column is missing red. The fewest primes, only two, are in the stretches 1 to 4, 4 to 9, 9 to 16 and 25 to 36. After that there are more of them on average. If we count the same thing for all n up to a thousand, we get this picture:
No dot lies on zero. Between 10002 and 10012, that is, between a million and the number 1,002,001, there are 152 primes. If the conjecture failed somewhere, the dot there would drop to zero, far below all its neighbours.
Why are there more of them when the primes thin out?
The bigger the numbers, the sparser the primes. Roughly speaking, near a number x about every ln x-th number is prime, where ln x is the natural logarithm. This is called the prime number theorem, and you can find out more about it in the article The Riemann hypothesis. Because ln 1,000,000 ≈ 14, roughly every fourteenth number near a million is prime. But that is only an average. The primes do not stand at regular intervals of fourteen; in some places they are close together, in others there is a longer gap between them. The logarithm grows very slowly: for a billion it is about 21, for a trillion about 28.
But the stretches between squares get longer much faster than the primes thin out. The stretch after n2 has length 2n + 1, and roughly every ln(n2)-th number in it is prime, that is, every 2ln n-th. So the number of primes we expect in the stretch is about
For large n we have 2n + 1 ≈ 2n, and the twos cancel:
That is the blue curve in the graph. For n = 100 it predicts 22 primes and there really are 23; for n = 1000 it predicts 145 and there are 152. The dots are scattered around the curve, but not wildly. The biggest shortfall below the curve is at n = 696: instead of the expected 106 primes there are 85, still a very long way from zero.
According to this argument, the number of primes between squares should keep growing for ever, and a stretch without a single prime would be an enormous coincidence. That is why hardly anyone doubts that the conjecture is true.
The gaps between primes point the same way. If the conjecture failed beyond some n, there would have to be two neighbouring primes there with a gap longer than 2n. Up to 1.8 · 1019 we know all the record gaps, that is, gaps longer than all the ones before them. The longest is 1,550 and lies around 1.8 · 1019. The stretch between squares there is over eight billion long. So the longest gap is more than a million times shorter than a counter-example would need.
But neither the argument about how the primes “roughly” thin out nor the tables of gaps prove anything. The primes are not random, and nobody can rule out a gap opening up somewhere far out.
What we know for sure: between a number and its double
Something similar has already been proved. Between 50 and 100 there is always a prime, between 1,000 and 2,000 too, and in general between every number (greater than 1) and its double. This was stated in 1845 by the French mathematician Joseph Bertrand and proved around 1850 by the Russian mathematician Pafnuty Chebyshev. Today it is called Bertrand’s postulate. It has been proved, but it has kept the name from the time when it was only a conjecture.
That is not enough for Legendre’s conjecture, because around a million the stretch between squares is five hundred times narrower than the stretch from one million to two million. And the bigger the numbers, the worse it gets.
Why the stretch between squares is so hard
Even so, mathematicians have been trying for almost a hundred years. In short: we can guarantee a prime in windows a little longer than the square root, but not in windows that are short enough.
Why would a short window be enough? Take a window that ends at the number x = (n + 1)2 and reaches some way to the left. If it is shorter than 2n + 1, it fits entirely into the stretch between n2 and (n + 1)2. So if every such window contained a prime, there would be a prime in the stretch too, and we would be home and dry.
The best result was proved in 2001 by Roger Baker, Glyn Harman and János Pintz. For sufficiently large x there is always a prime between
The number x0.525 is only a little more than the square root, which is x0.5. Around a million it comes out at about 1,413, which is even less than the length of the stretch, 2,001. So why isn’t that enough? There are two catches.
The first: the result only holds “for sufficiently large x”. The proof only says that some threshold exists, but nobody has calculated it. So we don’t know how far computers would have to check the conjecture for the proof to take over from there, and the space between what has been computed and what has been proved cannot be filled.
The second catch is more serious. The exponent 0.525 is greater than 0.5, and so the window x0.525 grows faster than the stretch
The blue bar grows. The exponent 0.525 would only be enough where the window is narrower than the stretch, that is, roughly up to 1012, and there it need not hold at all. But computers checked the conjecture that far long ago. Where a proof would be needed, the window is not enough. The difference between 0.525 and the 0.5 we need looks tiny, but nobody knows how to bridge it.
The green bar is even worse. The Riemann hypothesis is a famous conjecture about how regularly the primes are distributed, and a prize of a million dollars has been offered for solving it (more in the article The Riemann hypothesis). If it were true, we would know that the gaps between primes near a number x are at most roughly
For cubes, on the other hand, it was done back in the 1930s: there is a prime between n3 and (n + 1)3, at least for sufficiently large n. The stretch between cubes is much longer, about 3n2.
How far computers have checked it
A computer check published in 2025 went through all n up to 7.05 · 1013, that is, up to seventy trillion. The squares of numbers that large reach about 5 · 1027, which have 28 digits. The program even checked a stronger claim: if we split the stretch between n2 and (n + 1)2 in half at the number n(n + 1), there is a prime in each half. For example, the stretch from 100 to 121 is split by 10 · 11 = 110; in the first half there are the primes 101, 103, 107, 109, and in the second 113. This stronger version is called Oppermann’s conjecture, and it has not failed anywhere yet either.
Why isn’t that enough? Because conjectures about primes can fail very far out. The Pólya conjecture from 1919 claimed that among the numbers from 1 to n, at least half are always a product of an odd number of primes (for example, 12 = 2 · 2 · 3 is a product of three). It holds for all n less than 906,150,257 and only fails there for the first time. When Pólya stated it, nobody could calculate that far.
Almost primes
When you cannot prove there is a prime, you try something weaker. Every number can be written as a product of primes, its prime factors: 30 = 2 · 3 · 5 has three prime factors, 12 = 2 · 2 · 3 also three (the 2 counts twice), and a prime has only one, itself. The fewer prime factors a number has, the closer it is to being a prime. Numbers with few prime factors can therefore be thought of as “almost primes”.
Legendre’s conjecture asks for a number with one prime factor between every two consecutive squares. With two prime factors this was proved in 1975 by the Chinese mathematician Chen Jingrun, but only for sufficiently large n, again from a threshold that nobody knows. For all n, for a long time all that was known was that there is a number with at most four prime factors between squares.
In March 2026 a preprint appeared, that is, a paper that has not yet been peer-reviewed. Its author brought the four prime factors down to three, and for all n. For small numbers he relied on earlier computer checks, for large ones he used a sieve with precisely computed estimates. A sieve is a method that crosses out multiples of primes, similar to the sieve of Eratosthenes. Chen’s two and the new three prime factors do not contradict each other: the two only holds from an unknown threshold onwards, the three holds everywhere. But it is still a long way to the conjecture, that is, to one prime factor. We are writing this paragraph on 23 November 2026.
What is it good for?
It has no direct use. A counter-example would be a shock: somewhere far out on the number line the primes would unexpectedly avoid a whole stretch, even though according to the estimate n/ln n there should be trillions of them in it. A proof, on the other hand, would mean that we understand the gaps between primes much better than today, better than even the Riemann hypothesis would give us. It belongs to the same family of questions as Goldbach’s conjecture and twin primes: a school pupil can understand them, and they ask how the primes are scattered along the number line.
Try it yourself
Find all the primes between 100 and 121 and between 121 and 144. Then try a harder task: in which stretch between two consecutive squares from 102 to 302 are there the fewest primes? The prime number checker will tell you whether a number is prime. You can also check the first two answers in Figure 1; they are its last two columns.
Solution: between 100 and 121 there are five primes, 101, 103, 107, 109 and 113. Between 121 and 144 only four: 127, 131, 137 and 139. And that is also the answer to the second question. Between 102 and 302 the fewest primes, four, are in two stretches: from 121 to 144 and from 196 to 225, where we find 197, 199, 211 and 223. All the other stretches there have five or more.
You will find more famous problems in the category Famous problems.