Mathematical Curiosities in History

Triangular and Square Numbers as Figurate Numbers

How Greek thinkers arranged pebbles into triangles, squares and other shapes to study number, and what simple patterns the arrangements revealed.

On this page
  1. Numbers as shapes
  2. Triangular numbers
  3. Square numbers
  4. Relationships between shapes
  5. Beyond triangles and squares
  6. From pebbles to proof
  7. Number as a visible thing

Numbers as shapes

The words “square” and “cube” in modern arithmetic are fossils of an old habit of treating numbers as shapes. In Greek mathematics, numbers were often pictured as collections of dots or pebbles, and the way a collection could be arranged said something about the number. The Greek word for a pebble, psephos, also gave its name to calculation with counters. Later writers tell us that the Pythagorean school was especially fond of this practice, though what exactly the early Pythagoreans did is hard to separate from the accounts of later authors such as Nicomachus and Theon of Smyrna.

Triangular numbers

Arrange pebbles in rows of one, two, three and so on, each row one longer than the last, and you get a triangle. The totals are the triangular numbers: 1, 3, 6, 10, 15, 21. Each new triangle adds a row, so the nth triangular number is the sum 1 plus 2 plus up to n.

A compact formula follows from a simple picture. Put two copies of the same triangle together, one turned upside down, and they form a rectangle n rows high and n plus 1 columns wide. That rectangle holds n times (n plus 1) pebbles, so one triangle holds half of that, n times (n plus 1) divided by 2. For n equal to 4, this gives 4 times 5 divided by 2, or 10. The Greeks reasoned with pictures like this rather than with algebraic formulas.

The fourth triangular number, 10, held special significance as the arrangement of four rows, the figure known as the Pythagorean tetractys. The perfect number six is also triangular, being 1 plus 2 plus 3. Those themes belong to the history of Pythagorean symbolism; the point here is the geometry behind them.

Square numbers

Arrange pebbles in a grid with the same number in each row and column, and you get a square number: 1, 4, 9, 16, 25. The nth square number is n times n.

The Greeks noticed a pretty way to build squares. Start with a single pebble. To make the next square, add an L-shaped border of three pebbles. To make the next, add a border of five, then seven. Such an L-shaped addition was called a gnomon, the word also used for the part of a sundial that casts a shadow and for a carpenter’s square. The picture shows that the sum of the first n odd numbers is n squared: 1 plus 3 is 4, plus 5 is 9, plus 7 is 16.

Relationships between shapes

Once numbers are drawn, relationships can be seen by eye:

  • Two consecutive triangular numbers add to a square. Check: 3 plus 6 is 9, 6 plus 10 is 16, and 10 plus 15 is 25.
  • Oblong numbers, which are rectangles one unit longer than they are wide, are 2, 6, 12, 20, 30. Each equals twice a triangular number: 2 times 1, 2 times 3, 2 times 6, 2 times 10, 2 times 15.
  • Some numbers are both triangular and square. After 1 the next is 36, which is 8 times 9 divided by 2 and also 6 times 6. The next is 1225, which is 49 times 50 divided by 2 and also 35 times 35.

Proving such facts with algebra is easy now, but the Greek diagram made the reasons visible without symbols.

Beyond triangles and squares

The same method extends to pentagons, hexagons and other polygons. A pentagonal number arrangement gives 1, 5, 12, 22, with the nth term given by n times (3n minus 1) divided by 2. For n equal to 3 that is 3 times 8 divided by 2, or 12, and for n equal to 4 it is 4 times 11 divided by 2, or 22. Collectively these are called polygonal or figurate numbers. Hypsicles, in the second century BCE, is credited with an early general definition, and Diophantus wrote a treatise on polygonal numbers, of which only part survives.

Figurate numbers were also extended into three dimensions, producing pyramidal numbers made by stacking triangles or squares. A pile of cannonballs arranged in a square pyramid is the later, familiar example.

From pebbles to proof

In 1638, Pierre de Fermat stated that every whole number is the sum of at most three triangular numbers, at most four square numbers, at most five pentagonal numbers, and so on. He claimed to have a proof but did not publish it. Lagrange proved the square case in 1770, and Cauchy completed the general polygonal case in 1813. Gauss proved the triangular case in 1796. This shows how a Greek pastime with pebbles kept producing real problems.

A frequently told story has the young Gauss summing the numbers 1 to 100 in seconds, using the pairing idea that underlies the triangular formula: 100 times 101 divided by 2 is 5050. The anecdote is reported by later biographers, and its details vary, so it should be taken as a story about a real arithmetic trick.

Number as a visible thing

The figurate approach reflects an idea of number as something with form. In this picture, a number was not merely a size but a pattern, and different patterns showed different personalities. Later symbolic writers could attach meanings to these shapes, but the mathematical content stands apart from the symbolism: triangular numbers count the dots in a triangle, and square numbers count the dots in a square. That visual clarity is why figurate numbers are still used to introduce number patterns, including in classrooms today.

The complete guide to mathematical curiosities in history

Famous Number Sequences and Their Histories
Read the guide

Keep exploring

Guides from other topics

All topics →