In number theory, the sum of the first *n* cubes is the square of the *n*th triangular number. That is,

The same equation may be written more compactly using the mathematical notation for summation:

This identity is sometimes called **Nicomachus's theorem**.

## History

Many early mathematicians have studied and provided proofs of Nicomachus's theorem. Template:Harvtxt claims that "every student of number theory surely must have marveled at this miraculous fact". Template:Harvtxt finds references to the identity not only in the works of Nicomachus in what is now Jordan in the first century CE, but also in those of Aryabhata in India in the fifth century, and in those of Al-Karaji circa 1000 in Persia. Template:Harvtxt mentions several additional early mathematical works on this formula, by Alchabitius (tenth century Arabia), Gersonides (circa 1300 France), and Nilakantha Somayaji (circa 1500 India); he reproduces Nilakantha's visual proof.

## Numeric values; geometric and probabilistic interpretation

The sequence of squared triangular numbers is

- 0, 1, 9, 36, 100, 225, 441, 784, 1296, 2025, 3025, 4356, 6084, 8281, ... (sequence A000537 in OEIS).

These numbers can be viewed as figurate numbers, a four-dimensional hyperpyramidal generalization of the triangular numbers and square pyramidal numbers.

As Template:Harvtxt observes, these numbers also count the number of rectangles with horizontal and vertical sides formed in an *n*×*n* grid. For instance, the points of a 4×4 grid (or a square made up of 3 smaller squares on a side) can form 36 different rectangles. The number of squares in a square grid is similarly counted by the square pyramidal numbers.

The identity also admits a natural probabilistic interpretation as follows. Let be four integer numbers independently and uniformly chosen at random between 1 and Then, the probability that be not less than any other is equal to the probability that both be not less than and be not less than that is, Indeed, these probabilities are respectively the left and right sides of the Nichomacus identity, normalized over

## Proofs

Template:Harvs gives a particularly simple derivation, by expanding each cube in the sum into a set of consecutive odd numbers:

The sum of any set of consecutive odd numbers starting from 1 is a square, and the quantity that is squared is the count of odd numbers in the sum. The latter is easily seen to be a count of the form .

In the more recent mathematical literature, Template:Harvtxt uses the rectangle-counting interpretation of these numbers to form a geometric proof of the identity (see also Template:Harvnb); he observes that it may also be proved easily (but uninformatively) by induction, and states that Template:Harvtxt provides "an interesting old Arabic proof". Template:Harvtxt provides a purely visual proof, Template:Harvtxt provide two additional proofs, and Template:Harvtxt gives seven geometric proofs.

## Generalizations

A similar result to Nicomachus's theorem holds for all power sums, namely that odd power sums (sums of odd powers) are a polynomial in triangular numbers. These are called Faulhaber polynomials, of which the sum of cubes is the simplest and most elegant example.

Template:Harvtxt studies more general conditions under which the sum of a consecutive sequence of cubes forms a square. Template:Harvtxt and Template:Harvtxt study polynomial analogues of the square triangular number formula, in which series of polynomials add to the square of another polynomial.

## References

- Benjamin, Arthur T.; Orrison, M. E. (2002), "Two quick combinatorial proofs of ",
*College Mathematics Journal***33**(5): 406–408, http://www.math.hmc.edu/~orrison/research/papers/two_quick.pdf. - Benjamin, Arthur T.; Quinn, Jennifer L.; Wurtz, Calyssa (2006), "Summing cubes by counting rectangles",
*College Mathematics Journal***37**(5): 387–389, doi:10.2307/27646391, JSTOR 27646391, http://www.math.hmc.edu/~benjamin/papers/rectangles.pdf. - Bressoud, David (2004),
*Calculus before Newton and Leibniz, Part III*, AP Central, http://www.macalester.edu/~bressoud/pub/CBN3.pdf. - Garrett, Kristina C.; Hummel, Kristen (2004), "A combinatorial proof of the sum of
*q*-cubes",*Electronic Journal of Combinatorics***11**(1): Research Paper 9, MR 2034423, http://www.combinatorics.org/Volume_11/Abstracts/v11i1r9.html. - Gulley, Ned (March 4, 2010), Shure, Loren, ed.,
*Nicomachus's Theorem*, Matlab Central, http://blogs.mathworks.com/loren/2010/03/04/nichomachuss-theorem/. - Kanim, Katherine (2004), "Proofs without words: The sum of cubes—An extension of Archimedes' sum of squares",
*Mathematics Magazine***77**(4): 298–299, doi:10.2307/3219288, JSTOR 3219288. - Nelsen, Roger B. (1993),
*Proofs without Words*, Cambridge University Press, ISBN 978-0-88385-700-7. - Pengelley, David (2002), "The bridge between continuous and discrete via original sources",
*Study the Masters: The Abel-Fauvel Conference*, National Center for Mathematics Education, Univ. of Gothenburg, Sweden, http://www.math.nmsu.edu/~davidp/bridge.pdf. - Stein, Robert G. (1971), "A combinatorial proof that ",
*Mathematics Magazine***44**(3): 161–162, doi:10.2307/2688231, JSTOR 2688231. - Stroeker, R. J. (1995), "On the sum of consecutive cubes being a perfect square",
*Compositio Mathematica***97**(1–2): 295–307, MR 1355130, http://www.numdam.org/item?id=CM_1995__97_1-2_295_0. - Toeplitz, Otto (1963),
*The Calculus, a Genetic Approach*, University of Chicago Press, ISBN 978-0-226-80667-9. - Warnaar, S. Ole (2004), "On the
*q*-analogue of the sum of cubes",*Electronic Journal of Combinatorics***11**(1): Note 13, MR 2114194, http://www.combinatorics.org/Volume_11/Abstracts/v11i1n13.html. - Wheatstone, C. (1854), "On the formation of powers from arithmetical progressions",
*Proceedings of the Royal Society of London***7**: 145–151, doi:10.1098/rspl.1854.0036.