ARITHMETIC WORKSHEETS

Checking a cube sum with a triangular sum

The cubes 1, 8, 27 and 64 add to 100, which is the square of the triangular sum 10. This guide checks the identity and explains why it holds.

Two sums that agree

Add the first four positive integers and you get 10, a triangular number. Square it and you get 100. Now cube each of the same integers and add: 1 plus 8 plus 27 plus 64 is 100. The two answers agree. The general statement is that the sum of the first n cubes equals the square of the sum of the first n integers, which is n times n plus 1 divided by 2, squared. The worked cases confirm the n equal to 4 instance with the power calculator and the basic calculator, and the sections below show the identity for other n and explain the reason it holds.

Computing the squared triangular sum

The first four integers are 1, 2, 3 and 4. Their sum is 10, which also equals 4 times 5 divided by 2. The power calculator raises 10 to the second power and returns 100. This is the right side of the identity. The triangular number formula, n times n plus 1 over 2, comes from pairing the first and last terms: 1 plus 4, 2 plus 3, and so on, each pair giving n plus 1, with n over 2 pairs. Verifying 10 by direct addition and by formula guards against an arithmetic slip before squaring.

Computing the cube total in steps

Cube each integer: 1 cubed is 1, 2 cubed is 8, 3 cubed is 27 and 4 cubed is 64. Add the first two, 1 and 8, to get 9, then add 27 to reach 36, then add 64 to reach 100. The partial totals 1, 9, 36 and 100 are themselves the squares of 1, 3, 6 and 10, which are the triangular numbers 1, 3, 6 and 10. The identity therefore holds at every stage, not only at the end. The basic calculator handles each addition, and the final 100 matches the squared triangular sum.

More values of n

For n equal to 5 the triangular sum is 15 and its square is 225. The cube total is 100 plus 125, which is 225. For n equal to 10 the triangular sum is 55 and its square is 3,025, and the first ten cubes add to the same 3,025. For n equal to 1 both sides are 1, and for n equal to 2 both are 9. The identity is sometimes called Nicomachus's theorem. A quick table of n, the triangular number and its square makes a handy reference for checking hand calculations of cube sums.

Consecutive differences give the cube identity

The cleanest argument is by consecutive differences. The square of the nth triangular number minus the square of the previous one equals n cubed. With triangular numbers T(n) equal to n times n plus 1 over 2, T(n) squared minus T(n minus 1) squared factors as n times T(n) plus T(n minus 1), which is n squared, so the difference is n times n squared, equal to n cubed. For n equal to 4, 100 minus 36 is 64, which is 4 cubed. Adding the differences from 1 up to n makes the squares telescope, leaving T(n) squared as the total of the cubes.

Starting the range later

The identity assumes the integers start at 1. To sum cubes from 3 through 5, subtract the cubes of 1 and 2 from the total through 5: 225 minus 9 is 216, which equals 27 plus 64 plus 125. In general, a sum of cubes over a range is the difference of two squared triangular numbers. The same trick handles any consecutive range. A list that skips integers or starts at another number does not have a closed form of this kind, and each cube must be added individually or handled with a more general formula.

What the identity does not say

It would be wrong to read the identity as a general rule that the sum of cubes equals the cube of the sum. The cube of the sum of 1 through 4 is 10 cubed, which is 1,000, not 100. It also does not apply to arbitrary lists. For the numbers 2 and 3, the cubes add to 35, while the sum 5 squared is 25. The identity belongs to consecutive integers starting at 1. The power calculator shows the contrast: 10 squared is 100 and 10 cubed is 1,000, and only the first matches the cube total.

Using it as a shortcut

The closed form turns a long addition into a short one. The sum of the first 20 cubes is the square of 20 times 21 over 2, which is 210 squared, equal to 44,100. Without the identity you would cube twenty numbers and add them. The shortcut also provides a check for programs that compute cube sums in a loop, since a mismatch indicates a bug. Because both sides grow quickly, big inputs exceed the range of small integer types in some programming languages, so use a type that holds the result. For n equal to 1,000, the sum of cubes is the square of 500,500, which is 250,500,250,000. A 32-bit signed integer tops out near 2.1 billion, so that value would overflow. The identity also gives the sum cheaply when the individual cubes are too numerous to list. Teachers use it as a pattern puzzle because the arrays of cubes can be rearranged into a square.

One instance versus a general proof

The cases verify one instance, n equal to 4, with plain arithmetic. A single instance does not prove the identity for all n, and the difference argument above is what supplies the general reason. The page uses positive integers only. Other settings, such as sums of fourth powers or sums over real numbers, need different formulas. For a different range or exponent, derive or look up the right formula and check small cases first. For the plain sum of the first n integers, n times n plus 1 over 2 is exact for every n, and the sum of squares has its own closed form. The cubes are the only one of the three where the answer is the square of the first, which makes the identity a notable coincidence of structure and a useful memory aid, not a template for other powers.

Reproduce the checks

Squared triangular sum

Open the Power calculator and enter:

Base
10
Exponent
2

Expected output:

Power

100

The triangular sum includes one through four.

First three cubes

Open the Basic calculator and enter:

First number
9
Operation
add
Second number
27

Expected output:

Result

36

One cubed plus two cubed contributes nine.

Complete cube sum

Open the Basic calculator and enter:

First number
36
Operation
add
Second number
64

Expected output:

Result

100

The final cube matches the squared triangular total.

References and implementation scope

The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.

Related tasks