When Cubes Become a Square
The 2,000-Year-Old Identity Known as Nicomachus’s Theorem

MATHEMATICAL MYSTERIES
When Cubes Become a Square
The 2,000-Year-Old Identity Known as Nicomachus’s Theorem
Mathematics is full of patterns. Some are expected. Others feel accidental.
And then there are those rare formulas that seem almost too elegant to be true.
Here is one of them. Start with a few small cubes:

At first, this looks like a coincidence. The sum of cubes keeps becoming a perfect square, and not just any square. It is the square of the ordinary sum

The pattern is too clean to ignore, and it does not break.
Today, this identity is usually called Nicomachus’s theorem, after Nicomachus of Gerasa, an Ancient Greek Neopythagorean philosopher and mathematician who lived around the 1st or 2nd century CE. For his intellectual tradition, numbers were not just tools for calculation. They were signs of order, proportion, and harmony.
It is one of those rare mathematical facts that can be stated in a single line, checked by a child, and still admired by mathematicians.
The Theorem
The theorem, in its formal form, can be stated mathematically as follows:

Equivalently, if we expand the summations, the same identity becomes:

In words:
The sum of the cubes of the first n positive integers equals the square of their sum.
Since

the same identity can also be written as

For n = 4, the sum of the first four cubes is

The ordinary arithmetic sum of the same four numbers is

If we square that arithmetic sum, we get

So both paths lead to the same number: 100. This small example shows exactly what Nicomachus’s theorem claims in general.
Why This Identity Feels So Unusual
There are many formulas for sums of powers. Mathematicians know, for example, that the sum of squares satisfies

They also know formulas for fourth powers, fifth powers, and higher powers as well.
But these formulas quickly become more complicated. They work, but they do not have the same immediate visual clarity.
The sum of cubes is different. It does not merely have a formula. It collapses into the square of something already familiar:

That is the surprise. A sum of third powers becomes the square of a first-power sum.
This is not a clash between geometry and algebra. It is something subtler: two very different arithmetic operations produce the same number.
Nicomachus and the Ancient Pattern
Nicomachus discussed this pattern in his Introduction to Arithmetic. He did not prove it in the modern symbolic sense, but he recorded the essential numerical structure behind it. To a Neopythagorean thinker, such a pattern would have felt especially meaningful: a sum of cubes becoming the square of a triangular number was exactly the kind of numerical harmony that the Pythagorean tradition loved to find.

Medieval illustration of Plato (left) and Nicomachus (right) depicted as inventors of music, from a 12th-century manuscript. Image source: Wikimedia Commons, Cambridge University Library MS Ii.3.12, folio 61v, public domain.
The identity also appeared later in other mathematical traditions, including the work of Aryabhata in India and Al-Karaji in Persia. Across centuries and cultures, mathematicians kept returning to the same compact formula.
That is often how beautiful mathematics travels. A pattern is noticed, reused, reinterpreted, and eventually proved in many different ways.
Triangular Numbers Hidden Inside
To understand the theorem, we need triangular numbers.
If we arrange dots in rows of length 1, 2, 3, and so on, we obtain a triangle.

The first six triangular numbers represented as triangular arrangements of dots. Each figure adds a new row of dots. Image source: Wikimedia Commons, by Melchoir, licensed under CC BY-SA 3.0.
For the n-th triangle, the total number of dots is

This is the n-th triangular number, and it has the well-known formula

Nicomachus’s theorem can therefore be written more compactly as

So the identity says something very specific: the sum of the first n cubes is the square of the n-th triangular number.
This is already a much cleaner way to think about the formula. We are not merely adding cubes. We are building the square of a triangular number.
The Picture That Makes It Visible
The image below shows the identity for n = 5. At the top, the cubes 1³, 2³, 3³, 4³, 5³ are shown separately. Below, the same amounts are unfolded and arranged into one large square.

Visual proof of Nicomachus’s theorem. The cubes 1³, 2³, 3³, 4³, and 5³ are rearranged to form a single square whose side length is the triangular number 1 + 2 + 3 + 4 + 5 = 15. Image source: Wikimedia Commons, adapted from Nicomachus theorem 3D.svg by Cmglee, licensed under CC BY-SA 3.0.
For n = 5,

so the square has side length 15 and area

At the same time,

The figure turns the theorem into a jigsaw puzzle. Each colored region corresponds to one cube, but the pieces together form a square whose side is the triangular number T₅ = 15.
The identity stops being only a formula. It becomes something you can see.
The Hidden Mechanism: Odd Numbers
The picture shows that the identity is true. The odd numbers show why.
Look at the first few cubes:

Each cube is made from consecutive odd numbers. The first cube uses one odd number. The second cube uses the next two. The third cube uses the next three. The fourth cube uses the next four.
This pattern continues: n³ is the sum of n consecutive odd numbers.
Now recall the classical fact that the sum of the first m odd numbers is m². For example,

When we add

we are really adding the first

odd numbers. Their sum must therefore be

That is the engine of Nicomachus’s theorem. Cubes turn into a square because the cubes are secretly arranged as blocks of consecutive odd numbers, and odd numbers build squares.
A Multiplication Table View
There is another elegant way to see the same identity.
Take an n × n multiplication table. For example, when n = 4, the table is

If we add all the entries row by row, the total is

But we can also group the same table into nested L-shaped layers.
The first layer is just

The next L-shaped layer contains

The next one contains

The last one contains

Together, these layers give

The same multiplication table has therefore been counted in two ways. Row by row, it gives the square of a sum. Layer by layer, it gives a sum of cubes.
That is often where a mathematical identity becomes satisfying: the two sides are not merely equal because algebra says so. They are equal because they count the same object.
A Curious Appearance of 2025
The sequence generated by Nicomachus’s theorem begins

These are called squared triangular numbers.
One of them may look familiar. The number 2025 appears because

Indeed,

and

A mathematical identity from antiquity quietly contains a modern calendar year.
A Short Algebraic Proof
The identity can also be proved by induction. The idea is simple: first we check the formula for n = 1. Then we assume it is correct up to some value n, and we show that it must also be correct for the next value, n + 1.
For n = 1, it is true because

Now assume that the formula is true for some positive integer n:

To move from n to n + 1, we must add the next cube, (n+1)³, to the left-hand side. We add the same term to both sides.

The rest of the proof is just the simplification of the right-hand side. We want to show that it becomes the square of the next triangular number.

Factor out (n+1)²:

The expression in parentheses becomes

Therefore, the right hand side can be written as

This is exactly the square of the next triangular number,

So if the formula is true for n, it is also true for n + 1. Since it is true for n=1, it is true for every positive integer n.
A Pattern That Still Feels Magical
Nicomachus’s theorem has lasted because it does several things at once. It begins as a numerical surprise, becomes a statement about triangular numbers, turns visual through geometry, and finally reveals its mechanism through odd numbers.
The formula is small, but the structure behind it is rich.

A few cubes. A perfect square.
And a hidden pattern that has been surprising people for nearly two thousand years.
Cover image: Visual “proof without words” of Nicomachus’s theorem. Cubes of increasing size, 1³, 2³, 3³, 4³, and 5³, are rearranged to form a perfect square, illustrating the identity that the sum of cubes equals the square of the sum. Adapted from a Wikimedia Commons image by Cmglee, licensed under CC BY-SA 3.0.
메타데이터
- post_id
- bfbaa17e55a6
- slug
- when-cubes-become-a-square-bfbaa17e55a6
- url
- https://medium.com/think-art/when-cubes-become-a-square-bfbaa17e55a6
- canonical_url
- https://medium.com/think-art/when-cubes-become-a-square-bfbaa17e55a6
- author_url
- https://medium.com/@vplevris
- status
- ok
- fetched_at
- 2026-06-22 17:31:34