Geometry

Fifteen numbers decide every number

Lagrange proved that x² + y² + z² + w² takes every whole value. Ramanujan asked which other sums of four weighted squares do, and in 1917 listed fifty-five. One of them is wrong: x² + 2y² + 5z² + 5w² misses 15. The mistake points at a theorem found eighty years later — to know whether such a form reaches every number, it is enough to check that it reaches 1, 2, 3, 5, 6, 7, 10, 14 and 15. Nine checks decide infinitely many cases, and the nine numbers come out of an escalation any one can run.

Worth reading first: Six numbers that need five pentagons · Three triangular numbers, and no fewer.

Six numbers that need five pentagons followed Fermat’s claim about polygonal numbers back to its foundation, which is always a question about sums of squares. The oldest answer is Lagrange’s of 1770: every whole number is a sum of four squares, x2+y2+z2+w2x^2 + y^2 + z^2 + w^2. A natural generalisation is to weight the squares:

ax2+by2+cz2+dw2,a x^2 + b y^2 + c z^2 + d w^2,

with whole-number coefficients a≤b≤c≤da \le b \le c \le d, and ask which choices of coefficients still reach every whole number. Srinivasa Ramanujan asked exactly this in a paper of 1917, and answered with a list.

The fifty-four sums of four weighted squares that reach every number. The 54 universal diagonal quaternary forms, as coefficient lists: 1,1,1,1; 1,1,1,2; 1,1,1,3; 1,1,1,4; 1,1,1,5; 1,1,1,6; 1,1,1,7; 1,1,2,2; 1,1,2,3; 1,1,2,4; 1,1,2,5; 1,1,2,6; 1,1,2,7; 1,1,2,8; 1,1,2,9; 1,1,2,10; 1,1,2,11; 1,1,2,12; 1,1,2,13; 1,1,2,14; 1,1,3,3; 1,1,3,4; 1,1,3,5; 1,1,3,6; 1,2,2,2; 1,2,2,3; 1,2,2,4; 1,2,2,5; 1,2,2,6; 1,2,2,7; 1,2,3,3; 1,2,3,4; 1,2,3,5; 1,2,3,6; 1,2,3,7; 1,2,3,8; 1,2,3,9; 1,2,3,10; 1,2,4,4; 1,2,4,5; 1,2,4,6; 1,2,4,7; 1,2,4,8; 1,2,4,9; 1,2,4,10; 1,2,4,11; 1,2,4,12; 1,2,4,13; 1,2,4,14; 1,2,5,6; 1,2,5,7; 1,2,5,8; 1,2,5,9; 1,2,5,10.
Fig. 1 The fifty-four forms ax2+by2+cz2+dw2ax^2 + by^2 + cz^2 + dw^2 with a≤b≤c≤da \le b \le c \le d that represent every whole number, written as their four coefficients, found by testing only the fifteen numbers 1, 2, 3, 5, 6, 7, 10, 14, 15 and then confirmed on every number to three hundred. Ramanujan listed fifty-five in 1917; the fifty-fifth, 1, 2, 5, 5, misses 15.

Ramanujan’s list had fifty-five forms. Fifty-four are right. The fifty-fifth, x2+2y2+5z2+5w2x^2 + 2y^2 + 5z^2 + 5w^2, reaches every number up to 1414 and fails at 1515: no combination of a square, twice a square and five times two squares adds to fifteen. The figure finds the fifty-four by a test that would have caught the error at once — and the test consists of checking just nine numbers.

Two squares are far too few

Before four, two. The form x2+y2x^2 + y^2 reaches a number exactly when every prime of the form 4k+34k + 3 divides it an even number of times — Fermat’s theorem on sums of two squares, which two squares, and a lattice drew as points of a lattice on circles. That condition fails for most numbers. Edmund Landau showed in 1908 that the sums of two squares up to xx number about a constant times x/ln⁡xx/\sqrt{\ln x}, a vanishing share of all numbers, and almost no number is one traced how slowly that share falls.

Weighting does not rescue two variables. Which primes a form takes followed forms like x2+2y2x^2 + 2y^2 and x2+5y2x^2 + 5y^2 and found that each reaches only the primes in certain residue classes, so every two-variable form misses most numbers. The count of variables is doing the work: two variables leave out almost everything, three leave out infinite families and scattered stragglers, and four leave out nothing that a short check cannot find.

The classical cases

The theory starts from two cases that were settled long before Ramanujan.

The fewest square numbers adding to each number up to 120. Fewest square numbers summing to 1..120; the most ever needed up to 20000 is 4, by 3331 numbers.
Fig. 2 The numbers 1 to 120 shaded by the fewest squares that add up to each. Four always suffice — Lagrange’s theorem — and four are needed exactly by the numbers of the form 4a(8b+7)4^a(8b + 7): 7, 15, 23, 28, 31 and on without end.

Three squares do not suffice, and the reason is arithmetic. A square leaves remainder 00, 11 or 44 when divided by 88, and no three of those add to 77. So every number that is 77 more than a multiple of 88 needs four squares, and so does every such number multiplied by a power of four. Legendre proved in 1798 that these are the only exceptions, and so the form x2+y2+z2x^2 + y^2 + z^2 misses exactly the numbers 4a(8b+7)4^a(8b + 7). A three-variable form misses an infinite family, forced by a congruence; the four-variable form misses nothing.

The fewest triangular numbers adding to each number up to 120. Fewest triangular numbers summing to 1..120; the most ever needed up to 20000 is 3, by 10650 numbers.
Fig. 3 The numbers 1 to 120 shaded by the fewest triangular numbers that add to each. Three always suffice — Gauss’s theorem of 1796 — and more than half of all numbers need all three.

Why four suffice is a different kind of argument. The cleanest proof, which the integers among the quaternions followed, uses the fact that a product of two sums of four squares is again a sum of four squares — Euler’s identity, which is multiplication of quaternions written out — so it is enough to show that every prime is a sum of four squares, and for primes a counting argument does it. The four-variable case is special because four is the dimension in which squares multiply; nothing like Euler’s identity exists for three.

The triangular numbers are the same phenomenon in disguise. Three triangular numbers, and no fewer showed that nn is a sum of three triangular numbers exactly when 8n+38n + 3 is a sum of three odd squares, which Legendre’s theorem guarantees since 8n+38n + 3 is never 77 modulo 88. So Gauss’s Eureka is a statement about a weighted ternary form, and it holds for every number because the congruence that ruins three squares cannot occur.

Counting the ways, not only whether

Lagrange’s theorem says every number is a sum of four squares at least once. Carl Jacobi found in 1834 how many times: the number of ways of writing nn as x2+y2+z2+w2x^2 + y^2 + z^2 + w^2, counting signs and order, is

r4(n)=8∑d∣n4∤dd,r_4(n) = 8 \sum_{\substack{d \mid n \\ 4 \nmid d}} d,

eight times the sum of the divisors of nn that are not multiples of four. For n=1n = 1 that is 88 — the eight ways (±1)2+0+0+0(\pm1)^2 + 0 + 0 + 0 in each of four positions, halved for sign, doubled back. For n=15n = 15 it is 8(1+3+5+15)=1928(1 + 3 + 5 + 15) = 192. Since every nn has the divisor 11, the sum is never zero, and Lagrange’s theorem follows as the statement that r4(n)≥8r_4(n) \ge 8.

Jacobi’s formula came from the theory of theta functions, and it points at where the modern proofs live: counting representations by a form is computing the coefficients of a modular form, and the fifteen and 290 theorems both rest, in their hardest cases, on estimates for those coefficients. Hermann Minkowski gave a different, geometric proof of the four-square theorem, by placing a large enough convex body in a lattice, which one point in every big enough shape drew; it proves existence and says nothing about the count.

Escalating from a single square

Which weighted forms reach every number? Manjul Bhargava found in the 1990s a procedure that generates every candidate and explains the list of test numbers at the same time. It is called escalation.

Escalating from x²: the first number each form misses. Three-term diagonal escalators [1,1,1] misses 7; [1,1,2] misses 14; [1,1,3] misses 6; [1,2,2] misses 7; [1,2,3] misses 10; [1,2,4] misses 14; [1,2,5] misses 10.
Fig. 4 Start with x2x^2, which misses 2; add a term cy2cy^2 for each c up to 2, and each form misses a new number first; add a third term up to that number, and so on — Bhargava’s escalation. Drawn: the seven three-term forms it produces and the first number each misses: 7, 14, 6, 7, 10, 14, 10.

Start with x2x^2. It reaches 11 and misses 22. Any form that reaches every number must reach 22, so it needs a second term with coefficient at most 22: the candidates are x2+y2x^2 + y^2 and x2+2y2x^2 + 2y^2. The first misses 33; the second misses 55. Any universal form must therefore contain a third term with coefficient at most the number missed. That gives seven three-term forms, and each of them misses something: x2+y2+z2x^2 + y^2 + z^2 misses 77, x2+y2+2z2x^2 + y^2 + 2z^2 misses 1414, x2+2y2+5z2x^2 + 2y^2 + 5z^2 misses 1010, and so on.

No three-term form escapes. Every one misses a number, and so every universal form needs at least four terms. Continuing the escalation one more step produces a finite list of four-term forms, and Bhargava checked that each of them either reaches every number or misses 1515 first. The numbers that turn up as “first missed” anywhere in the escalation are exactly 1, 2, 3, 5, 6, 7, 10, 14, 15.

The fifteen theorem

That list is the content of the fifteen theorem, proved by John Conway and William Schneeberger in 1993 and given its short form by Bhargava in 2000: a positive definite quadratic form with integer matrix represents every whole number if and only if it represents 11, 22, 33, 55, 66, 77, 1010, 1414 and 1515. The name comes from the largest of them. Some small numbers are absent for a simple reason: 4, 8, 9 and 12 are square multiples of 1, 2 and 3, and a form that reaches a number reaches every square multiple of it by scaling the variables.

The theorem turns an infinite question into nine finite checks, each of which can be done by hand in a minute. The figure uses it exactly so: it runs through every choice of four coefficients with a≤b≤c≤da \le b \le c \le d, tests only the nine critical numbers, and finds that fifty-four forms pass. Then it confirms the theorem’s promise by checking each of the fifty-four against every number up to three hundred; none misses anything. Ramanujan’s fifty-fifth form fails the ninth test, and the theorem says that is the only way a form can fail.

The theorem is sharp: for each of the nine critical numbers there is a form that reaches every whole number except that one. And a companion theorem, the 290 theorem, conjectured by Conway and proved by Bhargava and Jonathan Hanke in 2005, does the same for forms whose cross terms may have odd coefficients: there the test set has twenty-nine numbers, the largest being 290290.

Ramanujan’s paper, and the check he did not run

Ramanujan’s 1917 paper, “On the expression of a number in the form ax2+by2+cz2+du2ax^2 + by^2 + cz^2 + du^2”, listed fifty-five forms and claimed that each represents every whole number. He gave proofs for many and indicated how the rest would go. In 1927 Leonard Dickson checked the list and found that x2+2y2+5z2+5u2x^2 + 2y^2 + 5z^2 + 5u^2 fails at 1515.

The error is instructive rather than embarrassing. The natural way to prove such a claim is to peel off the last term and use what is known about the three-variable form that remains. For 1,2,5,51, 2, 5, 5, representing 1515 means peeling off 5u25u^2 with u=0u = 0 or u=1u = 1, which leaves 1515 or 1010 for the form x2+2y2+5z2x^2 + 2y^2 + 5z^2 — and that ternary form misses both, as the escalation figure shows for 1010 and a short check confirms for 1515. A form can fail at one number and succeed everywhere else, and a proof that handles “large enough” numbers can miss a single small failure. The fifteen theorem is exactly the tool that makes such misses impossible to overlook, because it lists every small number at which a failure can hide.

What an integer matrix means

The fifteen theorem is stated for forms “with integer matrix”, and the condition is worth spelling out. A quadratic form in four variables can have cross terms, such as xyxy or zwzw. Written as a symmetric matrix, the coefficient of x2x^2 sits on the diagonal and half the coefficient of xyxy sits off it. The form has an integer matrix when all those entries are whole numbers — that is, when every cross term has an even coefficient.

A form like x2+xy+y2x^2 + xy + y^2 has an odd cross coefficient, and so falls outside the fifteen theorem, though it takes only whole-number values. Those forms are what the 290 theorem covers, with its longer list of twenty-nine test numbers topped by 290290. The diagonal forms in the figures have no cross terms at all, and so are covered by the fifteen theorem directly.

Why four variables and not three

The escalation shows that four terms are needed; the classical cases show why three cannot be enough in general. A three-variable form is too small to escape congruence conditions: arithmetic modulo a suitable number always rules out some residue class, as x2+y2+z2x^2 + y^2 + z^2 rules out 77 modulo 88. Four-variable forms have enough room that congruences rule out nothing, and the only obstructions are small numbers, which a finite check finds.

That is also why four-variable forms can be classified completely and three-variable forms cannot. For a four-variable form the set of numbers it misses is either empty or contains a small number from the critical list; for a three-variable form the set can be infinite, controlled by congruences, or it can contain scattered exceptions with no pattern at all. The scattered exceptions are what make ternary forms hard. A ternary form can miss finitely many numbers with no congruence to explain them, and there is no general method for knowing when the last such number has been found — which is exactly the position that one of Ramanujan’s own ternary forms, weighted lopsidedly towards its third square, is still in today. For four variables, by contrast, the analogue of a sporadic exception would have to be small, and the fifteen theorem’s list is where it would be.

Every critical number is somebody’s only miss

The nine test numbers are not a convenient overestimate. For each of them there is a form, of the kind the theorem covers, that reaches every whole number except that one. The form x2+2y2+5z2+5w2x^2 + 2y^2 + 5z^2 + 5w^2 is the example for 1515: it misses 1515 and, by the theorem, nothing else, since passing the other eight tests while failing the ninth leaves no other number at which it could fail. Bhargava called the smallest number a form misses its truant, and the theorem can be restated as: every truant of a form with integer matrix is one of the nine.

That makes the list minimal as well as sufficient. Remove any one of the nine and some form would pass every remaining test while still missing a number. Nine checks are enough, and no eight are. The escalation figure shows where several of them come from — 22, 33, 55, 66, 77, 1010 and 1414 appear there as the first misses of forms with up to three terms — and 1515 is the truant that the four-term stage adds.

Ramanujan’s lopsided ternary

Ramanujan’s 1917 paper contained a ternary form that shows the difficulty sharply.

The odd numbers x² + y² + 10z² misses. Odd numbers up to 10000 not of the form x² + y² + 10z²: 3, 7, 21, 31, 33, 43, 67, 79, 87, 133, 217, 219, 223, 253, 307, 391, 679, 2719.
Fig. 5 The odd numbers up to 10,000 that are not of the form x2+y2+10z2x^2 + y^2 + 10z^2 — 3, 7, 21, 31, 33, 43, 67, 79, 87, 133, 217, 219, 223, 253, 307, 391, 679, 2719 — on a logarithmic scale. The even numbers missed all have the shape 4a(16b+6)4^a(16b + 6), an infinite family explained by arithmetic modulo 16. The odd misses stop at 2719.

The form x2+y2+10z2x^2 + y^2 + 10z^2 misses an infinite family of even numbers, 4a(16b+6)4^a(16b + 6), for a congruence reason like Legendre’s. It also misses some odd numbers, and these follow no pattern: 3, 7, 21, 31, 33, 43, 67, 79, 87, 133, 217, 219, 223, 253, 307, 391, 679 — and then 2,7192{,}719, and then, as far as computation has gone, nothing more. The figure checks every odd number up to ten thousand and finds exactly these eighteen.

Searches since the 1990s have pushed far beyond ten thousand and found no further odd exception. Ken Ono and Kannan Soundararajan proved in 1997 that 2,7192{,}719 is the last one — provided the generalised Riemann hypothesis holds for certain functions attached to the form. Without that assumption, nobody can rule out a single sporadic odd number, far beyond any search, that the form misses.

What the tables and lists cannot show

Every representation is found by search. A number is marked as reached by a form when the figure finds whole numbers that produce it; a number is marked missed only after every combination has been tried. For the fifty-four forms and the escalation, the searches are complete for the ranges stated.

The fifteen theorem is used, not proved. The figure’s selection by nine test numbers relies on the theorem; its confirmation to three hundred is a check of the theorem’s prediction on a finite range, not a proof. Bhargava’s proof uses the escalation plus a careful analysis of each four-variable escalator, some of which need the deep theory of modular forms.

Diagonal forms only. The figures consider sums of weighted squares with no cross terms such as xyxy. The fifteen theorem applies to a larger class, and the 290 theorem to a larger class still; the diagonal ones are the forms Ramanujan listed and the easiest to draw.

Still open: whether 2,719 is the last

The odd numbers that x2+y2+10z2x^2 + y^2 + 10z^2 misses are believed to end at 2,7192{,}719. That they do is not proved unconditionally. The known unconditional results say only that the exceptions are finite in number, through work of William Duke and Rainer Schulze-Pillot on ternary forms, and give no bound on how large the last one can be — the argument is ineffective, proving finiteness without saying where the list stops.

So the situation is peculiar. It is known that the list of odd exceptions is finite; computation has found eighteen and searched far beyond the last; and the statement that there are no more follows from a hypothesis about the zeros of certain LL-functions that almost every mathematician believes. But a proof that avoids the hypothesis would need a way to bound sporadic representations of ternary forms effectively, and no such method exists. The same obstacle stands in front of the question six numbers that need five pentagons left open: whether every number beyond 33,06633{,}066 is a sum of three pentagonal numbers.

A finite window onto an infinite question

The habit worth keeping is to look for the finite test that settles an infinite question.

“Does this form reach every whole number?” asks about infinitely many numbers. The fifteen theorem says nine of them decide it, and the escalation explains which nine: they are the first numbers that the natural candidate forms miss, and a form that gets past all of them has nothing left to miss. Ramanujan’s error was caught by a check he could have done by hand, and the check was not discovered until the end of the century. For three variables no such window exists, and the last odd number that x2+y2+10z2x^2 + y^2 + 10z^2 misses is still known only conditionally.

What links here

Computed from the collection, not written here: the essays that point at this one.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

ConjectureExhaustive searchFinite checkQuadratic formRiemann hypothesisSum of squares