A Square and a Cube

Chapter 1 · Mathematics · Class 8 30 min read

Why This Matters

Here is a puzzle from the Ganita Prakash textbook.

A queen leaves her fortune of precious stones inside a safe. The code is hidden behind 100 lockers, numbered 1 to 100. A hundred people line up. Person 1 opens every locker. Person 2 toggles every 2nd locker — closes it if open, opens it if closed. Person 3 toggles every 3rd locker, Person 4 every 4th, and so on, up to Person 100.

At the end, only a few lockers are still open. They reveal the code. Which lockers stay open?

You could act it out, 100 lockers at a time. But there is a beautiful shortcut. A locker ends up open only if it was toggled an odd number of times. And how many times is a locker toggled? Exactly once for each of its factors. Locker 6 is touched by persons 1, 2, 3 and 6 — its four factors.

So the question becomes: which numbers from 1 to 100 have an odd number of factors? The answer turns out to be the square numbers — 1, 4, 9, 16, 25, … — and figuring out why is the start of this whole chapter.

This chapter is about squares and cubes: what they are, the secret patterns hidden inside them, and how to undo them with square roots and cube roots. By the end, the locker puzzle will feel obvious.

The Big Idea

A square number is what you get when you multiply a number by itself — like 5 × 5 = 25. A cube number is what you get when you multiply a number by itself three times — like 5 × 5 × 5 = 125. These two ideas come from real shapes: a square’s area is side × side, and a cube’s volume is side × side × side. Once you see squares and cubes as shapes made of unit pieces, their strange-looking patterns — odd factor counts, special last digits, sums of odd numbers — all start to make sense. And every square or cube can be undone: the square root and the cube root take you back to the side you started with.

Let’s Break It Down

We will go in order. First, square numbers and why they are called “squares”. Then the patterns hidden in perfect squares. Then square roots — how to undo a square. Then cube numbers, and finally cube roots.

Before we begin, let us refresh one idea the whole chapter leans on: factors and prime factorisation.

Square numbers and the area model

Back to the locker puzzle. We said a locker stays open only if it has an odd number of factors. Let us see why squares are the special numbers with an odd factor count.

Factors come in pairs. For 6, the pairs are 1 × 6 and 2 × 3. Each factor has a partner so that the two multiply back to 6. Because the partners are all different, the factors come in neat couples: 6 and 3 — that is 4 factors, an even number.

But look at 9. Its pairs are 1 × 9 and 3 × 3. Here something special happens: 3 partners with itself. We do not count that 3 twice — it is just one factor. So 9 has the factors 1, 3, 9 — that is 3 factors, an odd number.

This only happens when a number is a number times itself — that is, a square. The picture below shows both cases side by side.

Why squares have an odd number of factors: 6 has factor pairs 1 by 6 and 2 by 3 giving an even count of four, while 9 has 1 by 9 and 3 by 3 where 3 partners itself, giving an odd count of three.
Figure 1.1 — Why only square numbers have an odd number of factors. On the left, 6 is not a square: its factor pairs are 1 times 6 and 2 times 3, so its factors 1, 2, 3, 6 come in two neat couples — an even count of 4. On the right, 9 is a square: its pairs are 1 times 9 and 3 times 3. Here 3 partners with itself, so it is counted only once, leaving the factors 1, 3, 9 — an odd count of 3. A number has a factor that pairs with itself exactly when it is a square, so squares are the only numbers with an odd factor count.

So in the locker puzzle, every locker whose number is a square — 1, 4, 9, 16, 25, 36, 49, 64, 81, 100 — is toggled an odd number of times and stays open. There are exactly 10 of them.

Now, why do we even call 1, 4, 9, 16 “squares”? Because they are literally the areas of squares. A square with side 3 units is filled by 3 × 3 = 9 little unit squares. A square with side 4 holds 4 × 4 = 16. The number of unit squares (the area) is side × side. The figure below makes this clear.

Square numbers as areas: a 1 by 1 square holds 1 unit square, 2 by 2 holds 4, 3 by 3 holds 9, and 4 by 4 holds 16. Side times side equals the square number.
Figure 1.2 — Why we call them squares. Each grid is a square made of small unit squares. A 1 by 1 square holds 1 unit square; a 2 by 2 holds 4; a 3 by 3 holds 9; a 4 by 4 holds 16. The number of unit squares — the area — is always side times side. So multiplying a number by itself gives the area of a square, which is why 1, 4, 9, 16, 25 are called square numbers, or perfect squares.

We write this with a small raised 2. So 3 × 3 = 3² (read “three squared”), 4 × 4 = 4² = 16, and in general n × n = n². The squares of the natural numbers — 1, 4, 9, 16, 25, … — are called perfect squares.

You can square fractions and decimals too. For example (2.5)² = 2.5 × 2.5 = 6.25, and (³⁄₅)² = ³⁄₅ × ³⁄₅ = ⁹⁄₂₅. Squaring just means “multiply the thing by itself”, whatever the thing is.

Let’s use the factor idea on a slightly bigger number.

Worked example

Use factor pairs to show that 36 has an odd number of factors, and list them.

Concept check

In the locker puzzle, the queen's word-clue says the passcode is the first five locker numbers that were toggled exactly twice. Which five lockers are those?

Patterns hidden in perfect squares

If you write out the first squares — 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, … — they hide some neat patterns. These patterns are not just curiosities; they are quick tests you can use in exams.

Pattern 1 — the last digit. Look at the units digit (the last digit) of each square: 1, 4, 9, 6, 5, 6, 9, 4, 1, 0, 1, … Every perfect square ends in 0, 1, 4, 5, 6 or 9. None ever ends in 2, 3, 7 or 8.

Why? The last digit of a square depends only on the last digit of the number you squared. Square the digits 0 through 9 and look at their last digits: 0→0, 1→1, 2→4, 3→9, 4→6, 5→5, 6→6, 7→9, 8→4, 9→1. The results only ever end in 0, 1, 4, 5, 6 or 9. The digits 2, 3, 7, 8 simply never appear. So they can never be the last digit of a square.

This gives a one-glance test. The number 4,67,853 ends in 3, so it cannot be a perfect square. But be careful — the test only works one way.

⚠️ Common mistake
What students think

If a number ends in 0, 1, 4, 5, 6 or 9, then it must be a perfect square.

Why it seems right

The reverse rule — squares end only in those digits — is true and easy to remember, so it feels natural to flip it around and assume any number ending that way is a square.

What actually happens

The last digit can only tell you when a number is NOT a square. Ending in an allowed digit does not prove it is one. For example 26 ends in 6 but is not a square; 11 ends in 1 but is not a square. You must still check by another method.

Pattern 2 — zeros at the end. Square a number that ends in zeros and watch the zeros double. 10² = 100 (one zero → two zeros). 200² = 40000 (two zeros → four zeros). 700² = 490000 (two zeros → four zeros). So a square always has an even number of zeros at the end. A number ending in an odd number of zeros (like 1000, three zeros) can never be a perfect square.

Pattern 3 — parity. The square of an even number is even (2² = 4, 4² = 16). The square of an odd number is odd (3² = 9, 5² = 25). So a number and its square always have the same parity (both odd or both even).

Pattern 4 — squares are sums of odd numbers. This is the prettiest one. Look at the gaps between consecutive squares:

4 − 1 = 3

9 − 4 = 5

16 − 9 = 7

25 − 16 = 9

The gaps are the odd numbers 3, 5, 7, 9, … So if you add up odd numbers starting from 1, you keep landing exactly on the next square:

1 = 1 = 1²

1 + 3 = 4 = 2²

1 + 3 + 5 = 9 = 3²

1 + 3 + 5 + 7 = 16 = 4²

1 + 3 + 5 + 7 + 9 = 25 = 5²

This is not a coincidence — it has a lovely picture proof. Build a square out of dots, one inverted-L layer at a time. Each new L wraps around the previous square and adds the next odd number of dots. The figure below shows it.

A dot proof that 1 plus 3 plus 5 plus 7 plus 9 equals 25 equals 5 squared. Starting from one dot, each inverted-L layer of dots adds the next odd number and keeps the shape a perfect square.
Figure 1.3 — A visual proof that the sum of the first n odd numbers is n squared. Start with 1 dot (a 1 by 1 square, blue). Wrap an inverted-L layer of 3 green dots around it to make a 2 by 2 square of 4 dots. Add an L of 5 purple dots for a 3 by 3 square of 9. Add 7 yellow dots for 4 by 4 equals 16. Add 9 red dots for a 5 by 5 square of 25. Each L holds the next odd number of dots, and the whole shape stays a perfect square at every step. So 1 plus 3 plus 5 plus 7 plus 9 equals 25 equals 5 squared, and in general the first n odd numbers add up to n squared.

This pattern is also a test: a number is a perfect square exactly when you can reach 0 by subtracting 1, 3, 5, 7, … in turn. Take 25: 25 − 1 = 24, 24 − 3 = 21, 21 − 5 = 16, 16 − 7 = 9, 9 − 9 = 0. We subtracted 5 odd numbers and hit 0, so 25 = 5². Try 38 and you cross past 0 without ever landing on it, so 38 is not a perfect square.

The pattern also lets you jump from one square to the next. The n-th odd number is 2n − 1 (1st is 2×1−1 = 1, 6th is 2×6−1 = 11, and so on). So to get from one square to the next, add the right odd number.

Worked example

Given that 35² = 1225, find 36² without multiplying 36 by 36.

There is also a link to triangular numbers — 1, 3, 6, 10, 15, … (dots arranged in growing triangles). Add any two neighbouring triangular numbers and you get a perfect square: 1 + 3 = 4, 3 + 6 = 9, 6 + 10 = 16. Two triangles slot together into a square.

Square roots — undoing a square

Squaring takes a side and gives an area. The square root does the reverse: it takes the area and gives back the side.

Suppose a square garden has an area of 49 square metres. What is the length of its side? We need a number that, times itself, gives 49. Since 7 × 7 = 49, the side is 7 metres. We say 7 is the square root of 49, and write √49 = 7.

In general, if y = x², then x is a square root of y, written x = √y.

One subtlety: both 7 × 7 = 49 and (−7) × (−7) = 49 (a negative times a negative is positive). So a perfect square actually has two square roots, one positive and one negative: √49 = +7 or −7. In this chapter we will only use the positive square root.

So how do we test whether a big number like 324 is a perfect square, and find its root if it is? The most reliable method uses prime factorisation.

The idea: a perfect square is a number times itself. So in its prime factorisation, the primes must split into two identical groups. Whatever is in one group, multiplied out, is the square root. The figure below shows this for 324, and also shows a number (156) that fails the test.

Square root of 324 by prime factorisation: 324 is 2 times 2 times 3 times 3 times 3 times 3, which splits into two identical groups of 2 times 3 times 3 equals 18, so the square root is 18. Below, 156 is 2 times 2 times 3 times 13 which cannot be split into two equal groups, so it is not a perfect square.
Figure 1.4 — Finding a square root by pairing prime factors. The number 324 breaks into the six primes 2, 2, 3, 3, 3, 3. These split into two identical groups, Group A and Group B, each being 2 times 3 times 3 equals 18. Because both groups are the same, 324 equals 18 times 18, so it is a perfect square and the square root of 324 is 18 — one whole group. Below, 156 breaks into 2, 2, 3, 13. The two 2s pair up, but 3 and 13 have no partner, so the factors cannot split into two identical groups. Therefore 156 is not a perfect square.

Let’s run this test on a fresh number, step by step.

Worked example

Is 1156 a perfect square? If so, find its square root using prime factorisation.

What if the number is not a perfect square, but you still want a rough idea of its root? Then you estimate by trapping it between two squares you know.

Let’s estimate the square root of a number that isn’t a perfect square.

Worked example

Estimate √250 — find the whole number it is closest to.

Cube numbers — multiplying three times

Squares come from flat squares. Cubes come from solid cubes. A cube is a solid box where all edges are equal and all corners are right angles — like a dice or an ice cube.

How many tiny 1 cm cubes fit inside a cube of side 2 cm? Picture it as layers. The bottom layer is a 2 × 2 square of small cubes = 4 cubes. There are 2 such layers stacked up. So 2 × 2 × 2 = 8 small cubes. For a cube of side 3, each layer is 3 × 3 = 9 cubes, and there are 3 layers: 3 × 3 × 3 = 27. The figure below shows the idea.

Cube numbers as stacked unit cubes: side 1 holds 1 unit cube, side 2 holds 8 as two layers of 4, side 3 holds 27 as three layers of 9. The count is side times side times side, written n cubed.
Figure 1.5 — Why we call them cubes. A cube of side 1 is a single unit cube, so 1 times 1 times 1 equals 1. A cube of side 2 is built from 8 unit cubes — two stacked layers, each a 2 by 2 square of 4, giving 2 times 2 times 2 equals 8. A cube of side 3 holds 27 unit cubes — three layers, each a 3 by 3 square of 9, giving 3 times 3 times 3 equals 27. In general a cube of side n is made of n layers of n by n, which is n times n times n, written n cubed. So 1, 8, 27, 64, 125 are the perfect cubes.

We write a number times itself three times with a small raised 3. So 5 × 5 × 5 = 5³ (read “five cubed”) = 125, and in general n × n × n = n³. The numbers 1, 8, 27, 64, 125, … are called perfect cubes.

Is 9 a cube? No — 2³ = 8 and 3³ = 27, and there is nothing in between, so no number from 10 to 26 is a cube either. Cubes grow fast, so there are far fewer of them. Just like squares, you can cube fractions and negatives: (−6)³ = −6 × −6 × −6 = −216 (two negatives make a positive, then one more negative makes the answer negative).

Cubes hide patterns too. Add consecutive odd numbers in growing blocks and you get the cubes:

1 = 1³

3 + 5 = 8 = 2³

7 + 9 + 11 = 27 = 3³

13 + 15 + 17 + 19 = 64 = 4³

Block n uses n odd numbers, and they always add to n³.

There is a famous cube story. The mathematician Srinivasa Ramanujan was ill in hospital, and his friend G. H. Hardy came to visit. Hardy mentioned that his taxi was numbered 1729, a “rather dull number”. Ramanujan instantly replied that it was very interesting — it is the smallest number that can be written as the sum of two cubes in two different ways:

1729 = 1³ + 12³

1729 = 9³ + 10³

Because of this, 1729 is now called the Hardy-Ramanujan number, and such numbers are called taxicab numbers.

Concept check

A perfect square always ends in 0, 1, 4, 5, 6 or 9. Can you say the same about perfect cubes? Look at the cubes 1, 8, 27, 64, 125, 216, 343, 512, 729, 1000.

Cube roots — undoing a cube

Just as the square root undoes squaring, the cube root undoes cubing. Since 8 = 2³, we say 2 is the cube root of 8 and write ³√8 = 2.

In general, if y = x³, then x = ³√y.

To find a cube root, we use prime factorisation again — but with one change. For a square, we split the primes into two identical groups. For a cube, we split them into three identical groups. The figure below shows this for 3375, and shows 500 failing the test.

Cube root by triplets: 3375 is 3 times 3 times 3 times 5 times 5 times 5, which splits into three identical groups of 3 times 5 equals 15, so the cube root is 15. Below, 500 is 2 times 2 times 5 times 5 times 5, which cannot make three identical groups, so it is not a perfect cube.
Figure 1.6 — Finding a cube root by grouping prime factors in threes. The number 3375 breaks into 3, 3, 3, 5, 5, 5. These split into three identical groups, each 3 times 5 equals 15. Since all three groups are the same, 3375 equals 15 times 15 times 15, so it is a perfect cube and its cube root is 15 — one whole group. Below, 500 breaks into 2, 2, 5, 5, 5. The three 5s form one triple, but the two 2s cannot make a matching triple, so the factors will not split into three identical groups. Therefore 500 is not a perfect cube. For squares we pair factors in twos; for cubes we group them in threes.

Why threes? Because cubing a number repeats every prime factor three times. If 15 = 3 × 5, then 15³ = (3 × 5)³ = 3 × 3 × 3 × 5 × 5 × 5 — each prime appears exactly three times. So a number is a perfect cube exactly when each of its primes appears a number of times that is a multiple of 3, letting them form complete triples.

Let’s find a cube root from scratch.

Worked example

Find the cube root of 1728 using prime factorisation.

There is also a quick “guessing” trick for nice cube roots, using the last digit. The cubes of 0–9 end in 0,1,8,7,4,5,6,3,2,9 — and crucially each last digit is unique. So the last digit of a cube tells you the last digit of its cube root. For 1331: it ends in 1, and the only digit whose cube ends in 1 is 1, so the root ends in 1. Since 1331 is a 4-digit number between 10³ = 1000 and 20³ = 8000, the root is between 10 and 20. Ending in 1 → the root is 11. Indeed 11³ = 1331.

Common Mistakes

These trip up students every year. Spotting them now keeps the marks safe.

⚠️ Common mistake
What students think

The square root of a number times itself, like √(7 × 7), needs a calculation — you must work out 49 first, then find its root.

Why it seems right

Square root usually feels like a hard step that 'must be computed', so doing the multiplication first feels like the safe, proper way to start.

What actually happens

Squaring and square-rooting are opposite operations that cancel each other. √(7 × 7) = √(7²) = 7 straight away. There is no need to compute 49 and undo it. In general √(n²) = n.

⚠️ Common mistake
What students think

A square root and a cube root work the same way — split the prime factors into two equal groups for both.

Why it seems right

Both are 'roots' found by prime factorisation, and the square-root method of pairing is learnt first, so the brain reuses it for cubes by habit.

What actually happens

The number of groups must match the power. For a square root, split the primes into TWO identical groups. For a cube root, split them into THREE identical groups. One whole group is the root in each case.

⚠️ Common mistake
What students think

Squaring a number makes it bigger and cubing makes it even bigger, so squares are always smaller than the original number and roots are always smaller too — wait, so a square root must be larger than the number.

Why it seems right

With ordinary whole numbers bigger than 1, squaring does make things larger, so it is tempting to flip that and assume the inverse, the square root, must make things larger again.

What actually happens

The square root makes a number SMALLER (for numbers above 1), because it undoes the growth that squaring caused. √49 = 7, and 7 is smaller than 49. The root takes you back to the side, which is smaller than the area.

Quick Check

Answer each one, then read the explanation that appears.

Which of these numbers can you say at once is NOT a perfect square, just by its last digit?

How many of the numbers 1 to 100 stay open in the locker puzzle?

Using prime factors, which grouping correctly gives the square root of 324 (= 2 × 2 × 3 × 3 × 3 × 3)?

What is the cube root of 27000?

Practice Problems

Try each one yourself first, then tap to see the full solution.

Easy

easy

Find the length of the side of a square whose area is 441 m².

easy

Which of these are NOT perfect squares, just by checking the last digit: 2032, 2048, 1027, 1089?

easy

Find the cube roots of 64, 512 and 729.

Medium

medium

Find the smallest number by which 9408 must be multiplied so that the product is a perfect square. Then find the square root of that product.

medium

Find the smallest square number that is divisible by each of 4, 9 and 10.

medium

Without doing the full multiplication, find the sum 91 + 93 + 95 + 97 + 99 + 101 + 103 + 105 + 107 + 109.

Challenge

challenge

Decide if each statement is true or false, with a reason: (i) The cube of any odd number is even. (ii) There is no perfect cube that ends with 8. (iii) The cube of a 2-digit number may have seven or more digits.

challenge

Which is the greatest: (i) 67³ − 66³, (ii) 43³ − 42³, (iii) 67² − 66², (iv) 43² − 42²? Explain your reasoning without heavy calculation.

Summary

  • A number multiplied by itself is a square number; the squares of natural numbers (1, 4, 9, 16, …) are perfect squares. We write n × n as .
  • A number multiplied by itself three times is a cube number; 1, 8, 27, 64, … are perfect cubes. We write n × n × n as .
  • Only square numbers have an odd number of factors, because in a square one factor pairs with itself.
  • Perfect squares end only in 0, 1, 4, 5, 6 or 9, never in 2, 3, 7 or 8, and have an even number of trailing zeros. (A number ending in an allowed digit still need not be a square.)
  • The sum of the first n odd numbers is (a fact you can see by building a square out of inverted-L dot layers). Cubes are sums of blocks of consecutive odd numbers.
  • The square root undoes a square; the cube root undoes a cube. The symbols are and ³√.
  • A number is a perfect square if its prime factors split into two identical groups, and a perfect cube if they split into three identical groups. One whole group is the root.

What’s Next

You can now spot squares and cubes on sight, find their roots, and use their hidden patterns. That number-sense will keep paying off.

Next, in Chapter 2 — Power Play, you will go beyond squares and cubes to powers in general — what 2⁵ or 10⁸ really mean, the rules for multiplying and dividing powers, and how powers let us write enormous (and tiny) numbers neatly. The squaring and cubing you mastered here are just the first two steps of that bigger story. Onward!

Frequently Asked Questions

Why do only square numbers have an odd number of factors?

Factors come in pairs that multiply to give the number, like 1 and 6, or 2 and 3 for the number 6. In a square number one factor pairs with itself, like 3 and 3 for 9. That repeated factor is counted only once, so the total count is odd. Every non-square has its factors in clean, different pairs, giving an even count.

What digits can a perfect square end in?

A perfect square can only end in 0, 1, 4, 5, 6 or 9. It can never end in 2, 3, 7 or 8. So if a number ends in 2, 3, 7 or 8 you can say at once it is not a perfect square. But ending in an allowed digit does not prove it is a square.

How do you find a square root using prime factorisation?

Break the number into its prime factors. If you can split those primes into two identical groups, the number is a perfect square. The product of the primes in one group is the square root. For example 324 is 2 times 2 times 3 times 3 times 3 times 3, which splits into two groups of 2 times 3 times 3 equals 18, so the square root of 324 is 18.

How is finding a cube root different from finding a square root?

For a square root you split the prime factors into two identical groups and one group is the root. For a cube root you split them into three identical groups instead, and one group is the root. For example 3375 is 3 times 3 times 3 times 5 times 5 times 5, which makes three groups of 3 times 5 equals 15, so the cube root of 3375 is 15.

What is the Hardy-Ramanujan number 1729?

1729 is the smallest number that can be written as the sum of two cubes in two different ways. It is 1 cubed plus 12 cubed, and also 9 cubed plus 10 cubed. Ramanujan spotted this instantly when Hardy called it a dull taxicab number, so it is now called the Hardy-Ramanujan number.