Activity
OEIS A307491 and A307492 Are Complete: A Proof with Oranges and Elliptic Curves
Photo by Jen Gunter on Unsplash
Some numbers of oranges can be laid flat as a triangle with one orange exactly in the middle. Some can be stacked into a neat pyramid. Very few numbers can do both.
So far, people have known five numbers that can: 1, 4, 10, 4960 and 428536. Computers had searched up to numbers with 29 digits without finding a sixth, but nobody knew whether one was hiding further out.
I asked an AI (Anthropic’s Claude) to discover something new, and it produced a proof that there is no sixth number. The five known ones are all there are.
In mathematical terms: the sequence A307491 in the OEIS (the On-Line Encyclopedia of Integer Sequences), “Numbers that are both centered triangular and tetrahedral”, is finite and complete. (‘Tetrahedral’ basically means: having the shape of a pyramid with a triangular base.) The proof finds all lattice points on an elliptic curve, meaning all points whose coordinates are whole numbers. (Mathematicians call these ‘integral points’. The term comes from ‘integer’ and has nothing to do with integrals in calculus.) The same method shows that the sequence for A307492, “Numbers that are both centered square and square pyramidal”, is complete as well: 1, 5, 42925, 1026745.
This article explains the puzzle and then walks through both proofs. They rely on computer algebra software and have not yet been checked by a mathematician, so criticism is welcome. Simply highlight any passage you think is wrong and click ‘Criticize’ in the menu that appears.
The puzzle: which numbers are both centered triangular and tetrahedral?
Take 4 oranges. You can lay them flat – one in the middle, three around it – to make a triangle. Or you can build a little pyramid: three on the bottom, one on top.

Both shapes are drawn from above. The flat shape on the left is a single layer. The pyramid has two layers, with the dark orange sitting on top of the other three.
10 oranges, the next number in the sequence, work too. The flat shape is the bowling-pin triangle, which has one orange in its exact middle. The pyramid has layers of 6, 3, and 1.

In simple terms, the question is: which numbers of oranges can you turn into a flat triangle and then rearrange into a pyramid?

Most numbers fail. Flat centered triangles need 1, 4, 10, 19, 31, 46, … oranges. Pyramids need 1, 4, 10, 20, 35, 56, … oranges. A number only counts if it is on both lists. After 10 the lists drift apart, and the next matches are 4960 (a pyramid 30 layers tall) and 428536 (136 layers tall).

Mathematicians call the first list the centered triangular numbers (A005448) and the second the tetrahedral numbers (A000292). The numbers on both lists form A307491. Its OEIS entry says if a sixth term a(6) exists, it’s larger than 1029.
Why a computer search isn’t enough
A search can only ever say ‘nothing up to here’. Numbers never end, so no search rules out a sixth match. To close the question you need an argument that covers all numbers at once. That argument is the proof.
From figurate numbers to a Diophantine equation
A ‘figurate’ number is a number of dots (or oranges) that can be arranged into a regular geometric shape, like a triangle, square, or pyramid. Tetrahedral and centered triangular numbers are both examples. A Diophantine equation is one where only whole-number solutions count, named after the ancient Greek mathematician Diophantus. We want such an equation because we can’t have a fraction of a layer or ring.
First we need a formula for each shape. A centered triangle has one orange in the middle, and its rings hold 3, 6, 9, … oranges. With k rings, that adds up to
(3k² + 3k + 2)/2
oranges. (For k = 1 this gives 4, and for k = 2 it gives 10.) A pyramid’s layers hold 1, 3, 6, 10, … oranges, counting from the top. With m layers, that adds up to
m(m + 1)(m + 2)/6
oranges. (For m = 2 this gives 4, and for m = 3 it gives 10.) A number can make both shapes exactly when the two formulas give the same value. So the puzzle is a Diophantine equation: find all whole numbers m and k such that
(3k² + 3k + 2)/2 = m(m + 1)(m + 2)/6
The fractions and the mix of k² and k make this equation awkward to work with, so we tidy it up in two moves. First, multiply both sides by 24. (Multiplying by 12 would already clear the fractions, but the extra factor of 2 keeps everything in whole numbers in the next move.) The left side becomes 36k² + 36k + 24 and the right side becomes 4m³ + 12m² + 8m. Second, complete the square on the left: 36k² + 36k + 24 is the same as 9(2k + 1)² + 15. Substituting Y for 2k + 1 and moving the 15 to the other side, the equation turns into
9Y² = 4m³ + 12m² + 8m − 15
A square on one side and a cubic on the other: that’s the signature of an elliptic curve, a type of equation mathematicians have studied for well over a century and have strong tools for. Those tools expect a standard form in which the square and the cube stand alone, without the 9 and the 4 in front. A rescaling achieves that. Multiply both sides by 11664, chosen because 9 × 11664 = 324² and 4 × 11664 = 36³, and set X = 36m, V = 324Y:
V² = X³ + 108X² + 2592X − 174960
Nothing has been lost along the way: every solution of the orange puzzle gives a lattice point on this curve, meaning a point whose coordinates X and V are both whole numbers. The name comes from picturing the whole-number points of the plane as a regular grid, or lattice. So if we can list all lattice points on the curve, we have caught every solution of the puzzle.
The curve V² = X³ + 108X² + 2592X − 174960 near the first three solutions. Two more solutions (4960 and 428536 oranges) lie far off to the right, at X = 1080 and X = 4896.
The chart shows the part of the curve near the first three solutions. Only lattice points matter. Because the equation only involves V², and −V squared is the same as V squared, the full curve also has a mirror image below the horizontal axis, where V is negative. The chart leaves it out because a negative V would mean a negative number of rings, so we have no use for those points.
To see how a point on the chart relates to oranges, take (72, 972). Plugging X = 72 and V = 972 into the equation gives 944784 on both sides, and that is what it means for the point to be on the curve. The number of oranges comes from translating back. Since X = 36m, we get m = 72 ÷ 36 = 2 layers, and a pyramid with 2 layers has 4 oranges. Likewise, since V = 324Y, we get Y = 972 ÷ 324 = 3, and Y = 2k + 1 then gives k = 1 ring, which is also 4 oranges.
The proof: all lattice points on the elliptic curve
Step 1: only finitely many lattice points exist. This is Siegel’s theorem, which Carl Ludwig Siegel proved in his 1929 paper Über einige Anwendungen diophantischer Approximationen. It holds for every elliptic curve. Since our curve is elliptic, the list of solutions must end. But the theorem only says that the list is finite, not what is on it. The work is in finding all of them.
Step 2: determine the rank of the curve. A rational point is one whose coordinates are fractions. Two rational points on an elliptic curve can be combined into a third by a geometric rule: draw the line through them and see where it meets the curve again. Mathematicians call this process ‘adding’ points.1 On our curve, for example, the line through the points for 1 and 4 oranges meets the curve again exactly at the point for 10 oranges, as the chart below shows.2 All rational points can be built this way from a few ‘generator’ points, and the number of generators needed is the curve’s rank (the Mordell–Weil rank). We need the generators because step 3 starts from them. A standard method called 2-descent shows this curve has exactly rank 2. Two independent programs (mwrank and PARI/GP) agree, and mwrank reports the result as certain rather than conditional.
The straight line through the points for 1 and 4 oranges meets the curve again at the point for 10 oranges. At this scale, the dashed line and the curve are almost on top of each other.
The gap between the curve and the line, magnified. The curve crosses the line at exactly the three solutions.
Step 3: find every lattice point. Every lattice point is also a rational point, so it is some combination of the generators. The question is which combinations land on lattice points. There’s a known algorithm for answering it, published in 1994 by Stroeker and Tzanakis and, independently, by Gebel, Pethő, and Zimmer. It uses a theoretical upper bound on how large such a point can be (from the theory of linear forms in elliptic logarithms, which extends Baker’s method to elliptic curves), shrinks that enormous bound with a technique called LLL reduction, and then checks the small remaining range directly. The implementation in SageMath finds exactly 14 lattice points on this curve.
Step 4: translate back to oranges. Not all 14 lattice points correspond to an arrangement of oranges. To get back from a point to layers and rings, we divide: m = X ÷ 36 and Y = V ÷ 324. A point only counts if both divisions come out as whole numbers. For example, (304, 6220) is on the curve, but 304 ÷ 36 is about 8.4, and a pyramid can’t have 8.4 layers. Ten of the 14 points pass. They come in mirror pairs (V and −V), because squaring removes the sign. The points with negative V would mean a negative number of rings, so we drop them like we did above, which leaves five solutions. Recovering k from Y = 2k + 1, these are
| Number of oranges | k (rings) | m (pyramid layers) |
|---|---|---|
| 1 | 0 | 1 |
| 4 | 1 | 2 |
| 10 | 2 | 3 |
| 4960 | 57 | 30 |
| 428536 | 534 | 136 |
Those are the five known numbers. Since every solution of the puzzle must appear among the 14 points, there is no sixth. A307491 is finite and complete.
Second result: OEIS A307492 (centered square and square pyramidal) is complete, too
Now let’s replace triangles with squares. Take 5 oranges. You can lay them flat as a square with one in the middle. Or you can build a square pyramid: four on the bottom, one on top.

Which numbers are both a centered square number, 2k² + 2k + 1, and a square pyramidal number, m(m + 1)(2m + 1)/6? The same steps work. Setting the two formulas equal, multiplying by 12 and completing the square with Y = 2k + 1 gives 6Y² = 4m³ + 6m² + 2m − 6. Rescaling with X = 24m, V = 144Y then gives the elliptic curve
V² = X³ + 36X² + 288X − 20736
It also has rank 2 and 14 lattice points. Filtering them as in step 4 leaves these solutions:
| Number of oranges | k (rings) | m (pyramid layers) |
|---|---|---|
| 1 | 0 | 1 |
| 5 | 1 | 2 |
| 42925 | 146 | 50 |
| 1026745 | 716 | 145 |
So A307492 is complete: 1, 5, 42925, 1026745. Its OEIS entry had the same open ‘greater than 1029’ comment.
Reproduce it yourself
You don’t have to take the software steps on faith. Anyone can re-run them in SageMath, which is free. The following lines define the first curve (the one for flat triangles and triangular pyramids, A307491), compute its rank, and list its lattice points. The numbers in the first line are the coefficients of the curve’s equation.
E = EllipticCurve([0, 108, 0, 2592, -174960])C = E.mwrank_curve()print(C.rank(), C.certain())# 2 Trueprint(E.integral_points(both_signs=True))# [(36 : -324 : 1), (36 : 324 : 1), (72 : -972 : 1), (72 : 972 : 1),# (108 : -1620 : 1), (108 : 1620 : 1), (304 : -6220 : 1), (304 : 6220 : 1),# (477 : -11583 : 1), (477 : 11583 : 1), (1080 : -37260 : 1), (1080 : 37260 : 1),# (4896 : -346356 : 1), (4896 : 346356 : 1)]
With SageMath 10.8, the first line of output is “2 True”, meaning rank 2, proven. The second line lists the 14 lattice points. SageMath writes each one in the form (X : V : 1). In ordinary notation, they are (36, ±324), (72, ±972), (108, ±1620), (304, ±6220), (477, ±11583), (1080, ±37260) and (4896, ±346356). Checking that a given point lies on the curve only takes a calculator. The software is needed to be sure that there are no others.
For the second curve (the one for flat squares and square pyramids, A307492), replace the list in the first line with [0, 36, 0, 288, -20736]. The output is again “2 True”, and the 14 lattice points are (24, ±144), (36, ±288), (48, ±432), (85, ±937), (468, ±10512), (1200, ±42192) and (3480, ±206352).
A related search: the same number in several dimensions
A flat triangle and a pyramid belong to one family. There are also ‘triangles’ in four, five and more dimensions, and counting their oranges gives the numbers in Pascal’s triangle. That raises a similar question: which numbers show up in Pascal’s triangle in several different places? Its mirror symmetry makes most numbers show up at least twice. Showing up more often than that is rare: apart from one infinite family, only a few such numbers are known, such as 120 and 3003. How often a number can repeat like this is a famous open problem called Singmaster’s conjecture.
A 2017 paper by Blokhuis, Brouwer and de Weger lists the known repeats, checked up to 1060. It also lists the known pairs of such numbers that differ by exactly 1, like 252 and 253, checked up to 1030. Claude extended both checks to 1070 and found nothing new. Unlike the two results above, this is a search and not a proof, so it says nothing about numbers beyond 1070.
How much to trust these findings
- The whole thing was produced by my AI, not by me, and no mathematician has reviewed it yet. The advent of competent AI calls for some new etiquette so unqualified people like me can report potential discoveries to experts without wasting their time. I’m not aware of any such etiquette, so I decided to blog about the potential discovery first. As a result, I had to strike a balance between making the article accessible to a general audience while also speaking to mathematicians. Anyone with SageMath or Magma can recompute the lattice points of the two curves above in seconds (those programs call them ‘integral points’).
- As shown above, these proofs are computer-assisted. Steps 2 and 3 are standard, widely used algorithms, but I’m trusting their implementations.
- I’m not a mathematician. I was good at undergrad computer-science and business-school math but didn’t go beyond that. And that was a while ago. That said, I kept asking my AI questions about the math until I understood it, and I ran the SageMath script to reproduce the results. AI wrote this article but I heavily edited it.
- As a further check, my AI ran the same code on two related puzzles whose complete answers are already in the literature: square tetrahedral numbers (A003556) and numbers both triangular and square pyramidal (A039596). It reproduced both lists exactly.
- My AI searched for an earlier proof and found none, but I can’t rule out that one exists somewhere. (For what it’s worth, both OEIS entries are still open at the time of writing, and web and arXiv searches on both sequences’ terms together with ‘elliptic curve’ turned up no proofs.)
Strictly speaking, the ‘sum’ of two points is the mirror image of that third point across the horizontal axis: same X, opposite V. The mirror image of a lattice point is again a lattice point, so this detail doesn’t affect the argument. ↑
That whole-number result is an exception. Usually the new point has fractions as coordinates. For example, combining the 4-orange point with itself (using the line that just touches the curve there) leads to a point with X = 436/9. This is why lattice points are so rare. ↑