PrepShorts · Study sheet · Class 7 Mathematics · Chapter 6, Number Play
Chapter 6 · Number Play
Constructing magic squares, and where they came from
This video could not be loaded. Reload the page to try again.
Sign in with Google10 min.
Keep your place in this chapter — sign in, it’s free.Sign in
There are 362,880 ways to fill a three by three grid with 1 to 9. Checking one a second would take you over four days.
The idea
A magic square is not something you stumble on among 3,62,880 arrangements — it is forced, one deduction at a time, and the deductions all come from the same place: some cells sit on more lines than others. The centre lies on four lines, a corner on three, an edge cell on two, so the numbers with the least room to manoeuvre have to go where the fewest demands are made of them. That is why the magic sum must be 15, why 5 must sit in the middle, and why the smallest and largest numbers are pushed off the corners. Rewrite every entry as an offset from the middle number and the whole family opens up: any nine consecutive numbers will do, the magic sum is always three times the middle one, and the nine squares painted on a Navagraha Yantra turn out — once a single misprinted cell is put right — to be one square shifted nine times over.
What you should be able to do
- State the defining condition of a magic square, including the diagonals, and name the magic sum
- Show that a magic square built from 1 to 9 must have magic sum 15
- Show that its centre must be 5, using the chapter's elimination argument
- Explain why the smallest and largest numbers cannot sit in a corner
- Complete a 3 × 3 magic square once one full line has been placed
- Predict what happens to a magic square, and to its magic sum, when every entry is increased by a fixed amount or multiplied by a fixed amount
- Write a 3 × 3 magic square of consecutive numbers as offsets from its middle entry, and use that form to build one to order
- Name the Chautīsā Yantra and the Lo Shu Square, say roughly when and where each is from, and read the magic sum off each
Words to know
| Term | Definition in one line | First introduced |
|---|---|---|
| magic square | a square grid in which every row, every column and both diagonals reach the same total | printed in bold in §6.3, p.134 |
| magic sum | the total that every line of a magic square reaches | printed in bold in §6.3, p.134 |
| diagonal | a corner-to-corner line of cells, of which a square grid has two | printed in §6.3, p.134 |
| corner position | a cell at a corner of the grid, lying on a row, a column and a diagonal | printed in §6.3, p.136 |
| middle position | a boundary cell that is not a corner | printed in §6.3, p.136 |
| centre | the middle cell, the only one lying on all four lines | printed in §6.3, p.135 |
| Observation | the chapter's own label for each result it has just established | printed in bold in §6.3, pp.135–136 |
| generalised form | a magic square with its entries written as offsets from a letter-number | printed in §6.3, p.137 |
| Chautīsā Yantra | the 4 × 4 magic square inscribed at Khajuraho, named for its magic sum | printed in italics in §6.3, p.137 |
| Lo Shu Square | the earliest recorded magic square, from ancient China | printed in §6.3, p.138 |
| Navagraha Yantra | a nine-panel yantra, each panel carrying its own 3 × 3 magic square | printed in italics in §6.3, p.138 |
| Kubera Yantra | a yantra carrying a 3 × 3 magic square of nine consecutive numbers | printed in italics in §6.3, p.139 |
| line of the square | the explanation's collective word for a row, a column or a diagonal | an added term; not printed in this chapter |
Where people slip up
- "Magic just means the rows and columns match." The diagonals are part of the definition, and they are what makes the centre special. A grid with matching rows and columns and mismatched diagonals is the standard near-miss; show one.
- "You find a magic square by trying arrangements until one works." With 3,62,880 arrangements that is not a method, it is a hope. Every step from Observation 1 onward cuts the search down by reasoning, and by the end there is nothing left to search.
- "Nine cannot be at the centre because it is the biggest." Being biggest is not the reason. The reason is that every other cell shares a line with the centre, so a 9 in the middle would have to make 15 with the 8 as well — and 8 and 9 already overshoot. Say the shared-line fact out loud; without it the elimination looks like a lucky choice of example.
- "There are lots of different 3 × 3 magic squares using 1 to 9." There is one, appearing in eight guises — the four rotations and their mirror images. The chapter poses the counting question and leaves it open.
- "Adding 1 to every entry adds 1 to the magic sum." It adds 3, because each line has three cells. This is the single most common slip on this page, and the offsets form makes it obvious.
- "Magic squares need consecutive numbers." They do not — the chapter sets exactly that question, and multiplying every entry of a magic square by a constant already breaks consecutiveness while keeping the square magic.
- "The Chautīsā Yantra is a curiosity from a museum." It is a dated tenth-century inscription in a working temple, and 3 × 3 squares of the same family are still painted and sold today. Sections 11 and 12 exist to make the mathematics continuous with that, not to decorate it.
Ask your teacher a person
Your teacher reads this and writes back, usually within a day. For an instant answer, use Ask the video in the sidebar.
Your class sees the question and the answer. Only your teacher sees that it was you.
No questions on this topic yet.
Worked answers to this chapter’s exercises · this video explains Figure it Out · 6.3 Q1, Figure it Out · 6.3 Q2, Figure it Out · 6.3 Q3, Figure it Out · 6.3 Q4, Figure it Out · 6.3 Q5, Figure it Out · 4 Q1, Figure it Out · 4 Q2, Figure it Out · 4 Q3, Figure it Out · 4 Q4, Figure it Out · 4 Q5, Figure it Out · 6.5 Q4
Transcript1,449 words
A magic square is a grid where every line adds up to the same number. Every row. Every column. And both diagonals, corner to corner. Those count too, and they are the easiest thing to forget. Here is a grid where the rows all make fifteen, and the columns all make fifteen. It looks finished. It is not magic. One diagonal makes twelve. The other makes twenty-four. And that is not a rare accident. Of the seventy-two grids whose rows and columns are all level, only eight are magic.
The other sixty-four fail on the diagonals alone. So: eight lines, one total. And that total has a name. The magic sum. So how do you actually build one? The obvious answer is to try things. Put one to nine in, look at it, shuffle them, look again. There are three hundred and sixty-two thousand, eight hundred and eighty ways to fill that grid. If you checked one every second, without ever stopping, it would take you more than four days.
That is not a method. That is a hope. So we are going to do something else entirely. Every step from here cuts the search down, and by the end there will be nothing left to search. Not one square found. One square forced. Start with something we already have. The numbers one to nine come to forty-five. And the three rows of the grid, between them, hold all nine of those numbers.
So the three row totals come to forty-five as well. But in a magic square, the three row totals are all the same number. Three equal numbers, adding to forty-five. Forty-five divided by three. Fifteen. So the magic sum is not something anybody chooses. Before a single digit has been written down, it is fifteen. Next question. What goes in the middle? Try a nine there, and watch what breaks.
The middle cell shares a line with every single other cell on the board. That is the fact doing all the work here. So wherever the eight ends up, it is on a line with that nine. Nine and eight already make seventeen, and the line is only allowed to make fifteen. The third number on it would have to be minus two. There is no minus two. Now try a one in the middle instead. The two is somewhere, and it is on a line with it.
One and two make three, so the third would have to be twelve. There is no twelve either. Keep going, and the same thing happens to almost every candidate. A number can only sit in the middle if every one of the other eight can find a partner to make fifteen with it. I tried all nine. Exactly one survives. Five. And here is the same conclusion in one line, if you would rather have it short.
The four lines through the middle pair the other eight numbers off, and each pair has to total fifteen take away the middle. Those eight numbers add up to forty-five take away the middle. Set the two against each other, and only one number works. Five. So the middle cell was never a choice either. But why is the middle so special? Count the lines running through each kind of cell.
Through the middle: a row, a column, and both diagonals. Four. Through a corner: a row, a column, and one diagonal. Three. Through a cell partway along an edge: a row and a column. Two, and no diagonal at all. Four, three, two. That is the whole shape of this puzzle. A number in a busy cell has to satisfy four demands at once. A number in a quiet cell has to satisfy two.
So the awkward numbers — the ones with the fewest ways of working — belong where the fewest demands are made of them. Take the one. Where can it go? Suppose it sits in a corner. Three lines run through a corner. Each of those lines has the one on it, so each needs two more numbers making fourteen between them. Three lines. Three different pairs, all adding to fourteen.
Let us see what is on offer. Five and nine. Six and eight. And that is the lot. There is no third pair. So the one cannot be in a corner. Do the same for the nine and you need three pairs making six: one and five, two and four, and nothing after that. Both get pushed onto the edges. And it is never about being big or small — five has four such pairs, and this argument says nothing about five.
We now know enough to build the thing. Five in the middle. One somewhere along an edge. Put the one on the left edge, in the middle row. The five is already next to it. One and five make six, so the last cell in that row has to be nine. And there it is. One, five, nine, straight across the middle. Everything else now falls out. The two corners on the left are in a column with that one, so they have to make fourteen between them.
Six and eight, and there is no other pair that does it. The diagonals decide which way round. Two ways to finish, and they are mirror images. In fact there is only one magic square here at all — it turns up in eight guises: four turns and their reflections. Now something worth being careful about. Here is the square. Add one to every single entry. Is it still magic? Yes, it is.
But look at the magic sum. It was fifteen. It is now eighteen. Not sixteen. Eighteen. Because every line has three cells in it, and you have just added one to all three of them. Add one, the sum goes up by three. Add ten, the sum goes up by thirty. Now double every entry instead. Still magic, and the sum doubles to thirty. But the numbers are no longer consecutive — so a magic square never needed consecutive numbers at all.
Which brings us to the best idea in all of this. Forget the actual numbers. Call the middle one m, and write every other cell as an amount above or below it. In our square the middle is five, so the nine becomes m plus four, and the one becomes m minus four. Do that to all nine cells, and the offsets run from minus four up to plus four, with nothing in the middle.
Now add up any line at all. The offsets cancel out. They come to nothing. And what is left is three m. Three times the middle number, on every line, every time. So you can build one to order. Want the middle to be twenty-five? The magic sum is seventy-five, and you are finished. Want a magic sum of sixty? Divide by three. The middle is twenty, and the nine numbers run from sixteen to twenty-four.
One more square, and this one is not made of one to nine. It is four by four, and it is carved into the stone of a temple at Khajuraho, in central India. It was cut in the tenth century. It has been sitting on that wall for about a thousand years. Every row makes thirty-four. Every column makes thirty-four. Both diagonals, thirty-four. But this one goes a good deal further than it had to.
Take the four numbers in any quarter of it. Thirty-four. The four in the very middle. Thirty-four. The four corners. Also thirty-four. Altogether eighty-six different groups of four cells in it come to thirty-four, out of one thousand eight hundred and twenty you could pick. Whoever cut that was not guessing. And the three by three we built is older still. It appears in China more than two thousand years ago, in a story about a flood and a turtle with dots on its shell.
Two, seven, six. Nine, five, one. Four, three, eight. Check it. Fifteen every way you read it. It is our square, turned round. You will also find these on painted yantras, where nine panels each carry their own small square, and every panel has a different magic sum. Fifteen. Eighteen. Twenty-one. And so on, up the panels. Every one of those is the same square with a number added to every cell. One square, nine times over, exactly as the offsets promised.
Which leaves one last question. If adding shifts the magic sum, what if you shift it all the way to nothing? Keep the offsets, set the middle to zero, and every line adds up to nothing at all.
Where this fits
Taken from the notes each video was made from, not from the reading order — these are the ideas this one rests on and the ones that later rest on it.
Builds on
- Using row and column sums to prove a grid cannot be filledClass 7 · Ch 6, Number Play
- Brackets decide which operation happens firstClass 7 · Ch 2, Arithmetic Expressions
Either side of this one
- Virahāṅka–Fibonacci numbers, and the poetry-counting problem that produced themClass 7 · Ch 6, Number Play