ExamSaathi learning library · Government exams · SSC CGL quantitative foundations; published syllabus labelled 2024 · Quantitative aptitude
Sums of the first n natural numbers, squares and cubes
Add 1 + 2 + ... + n, the first n squares and the first n cubes with three short formulas, n(n + 1)/2, n(n + 1)(2n + 1)/6 and (n(n + 1)/2)^2, then extend them to odd numbers, even numbers and multiples, and to any range such as 11 to 30 by subtracting two sums.
Status: original pilot lesson. Teacher review is pending. It is not a complete course or official exam material.
You will learn to
- Use n(n + 1)/2, n(n + 1)(2n + 1)/6 and (n(n + 1)/2)^2 to find the sums of the first n natural numbers, squares and cubes.
- Explain why the sum of the first n cubes equals the square of the sum of the first n natural numbers, and test each sum formula on a small case.
- Find the sums of the first n odd numbers and of the first n even numbers as n^2 and n(n + 1), after counting how many numbers the list holds.
- Find sums of natural numbers, squares or cubes over a range such as 11 to 30 by subtracting the sum up to 10 from the sum up to 30.
Before you start
The natural numbers are 1, 2, 3, 4 and so on. The first n of them are 1, 2, ..., n, their squares are 1, 4, 9, ..., n^2, and their cubes are 1, 8, 27, ..., n^3. Adding a long list one number at a time is slow and easy to get wrong, so this lesson uses three closed formulas, each of which needs only n. Books often write such sums in sigma notation: the sum of i^2 for i = 1 to n means 1^2 + 2^2 + ... + n^2. The letter x always means multiply here, so n(n + 1) means n x (n + 1). Before using any formula, be sure what is being added, and where the list starts and stops.
The core rule: three formulas for 1 to n
Numbers: 1 + 2 + ... + n = n(n + 1)/2. Picture a staircase of dots with 1 dot in the first column, 2 in the second, and so on up to n. A second, identical staircase turned upside down fits on top of it to make a rectangle n columns wide and n + 1 dots tall, so one staircase holds half of n(n + 1) dots. Squares: 1^2 + 2^2 + ... + n^2 = n(n + 1)(2n + 1)/6. Cubes: 1^3 + 2^3 + ... + n^3 = (n(n + 1)/2)^2, which is the square of the first sum, so the cube rule says 1^3 + 2^3 + ... + n^3 = (1 + 2 + ... + n)^2. Test each on n = 3: 1 + 2 + 3 = 3 x 4 / 2 = 6; 1 + 4 + 9 = 3 x 4 x 7 / 6 = 14; 1 + 8 + 27 = 36 = 6^2. The divisions always come out exact, so cancel early if you like: for n = 20, the squares add up to 20 x 21 x 41 / 6 = 10 x 7 x 41 = 2870.
A method: why the squares formula holds
Start from (k + 1)^3 - k^3 = 3k^2 + 3k + 1, which is just the expansion of (k + 1)^3. Write it out for k = 1, 2, 3, ..., n and add all n lines. On the left almost everything cancels, since 2^3 - 1^3, then 3^3 - 2^3, and so on, leave only (n + 1)^3 - 1. On the right, the 3k^2 parts give 3 times the sum of squares, the 3k parts give 3 x n(n + 1)/2, and the 1s give n. Solving for the sum of squares and factorising gives n(n + 1)(2n + 1)/6. For n = 7 the left side is 8^3 - 1 = 511, and the right side is 3 x 140 + 3 x 28 + 7 = 420 + 84 + 7 = 511, where 140 = 7 x 8 x 15 / 6 is the sum of the first 7 squares. The same cancelling trick, started from (k + 1)^4 - k^4, leads to the cube formula.
A second idea: odd numbers, even numbers and multiples
The first n even numbers are 2, 4, ..., 2n. Each is 2 times a natural number, so their sum is 2 x n(n + 1)/2 = n(n + 1). The first n odd numbers are 1, 3, ..., 2n - 1. Together with the first n even numbers they make up all of 1 to 2n, so their sum is 2n(2n + 1)/2 - n(n + 1) = n^2. Count before you add: an odd list ending at L holds (L + 1)/2 numbers, and an even list ending at L holds L/2. So 1 + 3 + ... + 49 has 25 numbers and adds up to 625, while 2 + 4 + ... + 50 has 25 numbers and adds up to 25 x 26 = 650. Any list of multiples works the same way: 7 + 14 + ... + 70 = 7 x (1 + 2 + ... + 10) = 7 x 55 = 385. Squares of even numbers carry a factor of 4: 2^2 + 4^2 + ... + (2n)^2 = 4 x n(n + 1)(2n + 1)/6.
A further case: sums over a range
A sum that starts part-way, such as 21 + 22 + ... + 40, is the sum up to 40 minus the sum up to 20: 40 x 41 / 2 - 20 x 21 / 2 = 820 - 210 = 610. The number to subtract up to is the one just before the start, 20 and not 21, because 21 belongs to the range. This is the rule that a sum from 1 to n splits into a sum from 1 to m and a sum from m + 1 to n. The same split works for squares and cubes: 6^2 + 7^2 + ... + 15^2 = 1240 - 55 = 1185, and 6^3 + 7^3 + ... + 10^3 = 3025 - 225 = 2800. A plain range of numbers can also be checked another way: count the numbers, 40 - 21 + 1 = 20, and multiply by the average of the first and last, (21 + 40)/2 = 30.5, which gives 610 again. That shortcut fails for squares and cubes, because they are not evenly spaced.
Common mistakes
Subtracting the sum up to the first number of a range instead of the number before it, which drops that first number. Forgetting to halve in n(n + 1)/2. Using n^2 for the first n natural numbers, or n(n + 1)/2 for the first n odd numbers. Taking n to be the last number of an odd or even list: 1 + 3 + ... + 59 holds 30 numbers, not 59. Mixing up the square and cube formulas, or forgetting to square n(n + 1)/2 in the cube formula. Treating 1^2 + 2^2 + ... + n^2 as (1 + 2 + ... + n)^2; that equality belongs to cubes, not squares. Multiplying an even-squares sum by 2 instead of 4. Using the average shortcut on squares or cubes.
A routine for sums of natural numbers, squares and cubes
1. Write down what is being added: plain numbers, odd numbers, even numbers, multiples, squares or cubes. 2. Find where the list starts and stops, and count n. 3. Pick the formula: n(n + 1)/2, n^2, n(n + 1), n(n + 1)(2n + 1)/6 or (n(n + 1)/2)^2, taking out any common factor such as 2, 4 or 7 first. 4. For a list that starts part-way, subtract the sum up to the number just before the start. 5. Check with a small case, such as n = 2 or n = 3, or with a rough estimate of the size.
Worked examples
A sweet shop in Bikaner stacks laddoos in a square pyramid: 1 laddoo on top, then a 2 by 2 layer, a 3 by 3 layer, and so on down to a 12 by 12 layer at the bottom. How many laddoos are in the stack?
- The layers hold 1^2, 2^2, 3^2, ..., 12^2 laddoos, so the total is the sum of the first 12 squares.
- Use n(n + 1)(2n + 1)/6 with n = 12: 12 x 13 x 25 / 6.
- Cancel first: 12/6 = 2, so the sum is 2 x 13 x 25 = 650.
- Check: the first 11 squares add up to 11 x 12 x 23 / 6 = 506, and adding the bottom layer of 144 gives 506 + 144 = 650.
Answer: The stack has 650 laddoos.
Anil, revising for a test in Patna, reads 11 pages on day 1, 12 pages on day 2, and one page more on each later day, finishing with 30 pages on the last day. How many pages does he read in all?
- He reads 11 + 12 + ... + 30 pages, a range that starts part-way.
- Sum up to 30 = 30 x 31 / 2 = 465. Sum up to 10 = 10 x 11 / 2 = 55.
- Pages read = 465 - 55 = 410. Subtract the sum up to 10, not 11, because day 1 itself has 11 pages.
- Check: there are 30 - 11 + 1 = 20 days, and the average day is (11 + 30)/2 = 20.5 pages, so 20 x 20.5 = 410.
Answer: Anil reads 410 pages.
A toy maker in Channapatna turns wooden cubes with edges of 1 cm, 2 cm, 3 cm and so on up to 10 cm, one of each. What is their total volume?
- The volumes are 1^3, 2^3, ..., 10^3 cm^3, so the total is the sum of the first 10 cubes.
- First find 1 + 2 + ... + 10 = 10 x 11 / 2 = 55.
- Sum of the cubes = 55^2 = 3,025.
- Check the start of the pattern: 1 + 8 + 27 = 36 = 6^2, and 6 = 1 + 2 + 3, just as the rule says.
Answer: The total volume is 3,025 cm^3.
Practice checks
- Payal, who runs a shop in Indore, saves Rs. 1 on 1 March, Rs. 2 on 2 March, and so on, saving Rs. 31 on 31 March. How much does she save in March?
- What is 1 + 3 + 5 + ... + 59?
- A young bowler at a cricket academy in Pune bowls 2 balls on day 1, 4 on day 2, 6 on day 3, and so on, bowling 40 balls on day 20. How many balls does he bowl in the 20 days?
- What is 1^3 + 2^3 + 3^3 + ... + 15^3?
- A tile maker in Morbi makes one square tile of each side length 11 cm, 12 cm, 13 cm and so on up to 20 cm. What is the total area of the ten tiles?
Sources checked
- SSC CGL Scheme and Syllabus, labelled 2024 — Tier-I Quantitative Aptitude and Tier-II Mathematical Abilities (Computation of whole numbers; relationships between numbers); not verified as the full 2026-cycle syllabus
- OpenStax, Calculus Volume 1 — Section 5.1, sigma notation and the rule on sums and powers of integers: the sum of i for i = 1 to n is n(n + 1)/2, the sum of i^2 is n(n + 1)(2n + 1)/6 and the sum of i^3 is n^2(n + 1)^2/4, and a sum can be split into two ranges; the odd, even and multiple cases are worked out in the lesson; mathematical relationships only