SEED Science

Solution: Math Puzzle: More Magic Squares

Solution: More Magic Squares Math Puzzle

Puzzle 1

The goal is to place all the numbers from 1 to 9 inside one of the squares so that all the lines passing through the center square add up to the same number.

Squares

You’ll quickly discover when you try to solve this that the number in the center square, which is part of every sum, must be 5, the number in the middle of the set. After that, it doesn’t matter which box you start in. Suppose you start with the largest number of the remaining numbers, 9. Then put the smallest remaining number, 1, in the opposite box to get a sum of 9 + 5 + 1 = 15.

Squares

 

Next choose the largest and smallest of the remaining numbers, 8 and 2. Adding them to 5 also gives 15. It doesn’t matter which boxes they go in as long as they are opposite each other. The last two pairs of numbers that complete the puzzle are 3 and 7, 6 and 4.

Squares

 

 

 

Puzzle 2

Having solved puzzle 1, puzzle 2 is relatively easy. Use the same ideas: Put 5 in the middle, and use 9 and 1, 8 and 2, 7 and 3, and 6 and 4 to add to 5 to make 15. This time the position does matter, because the lines have to add up in more than one direction.

You can try some different possibilities. For example, start with 5 in the middle and 9 and 1 along one diagonal. Let’s see if we can make that work.

9

   
 

5

 
   

1

 

Now look for where we can place the next two numbers, 8 and 2. The 8 can’t go in either of the two remaining corners, and it can’t go along a row or column that includes 9. So the 8 must go in a side or bottom box with the 2 opposite it.

9

   

2

5

8

   

1

   

Now since 9 and 2 are 11, we need a 4 in the lower left corner to add vertically to 15. This means we need a 6 in the upper right corner.

At first this looks good because on the right hand column, 6 + 8 + 1 also equals 15. But if we look across the top, we see it can’t work because 9 + 6 are already 15. Zero would have to go in the middle, which is not allowed. Similarly, along the bottom row, 4 + 1 = 5, so we’d need a 10 in the middle. Also not allowed. So we have to conclude that our starting move, putting 9 in a corner, was incorrect. (It doesn’t matter which corner—we can’t have 9 in any corner and complete the magic square. If you’re not convinced, try it yourself.)

Instead, let’s put 9 and 1 down the center column. We could try 9 and 1 across the center row—the result would be the same.

 

9

 

6

2

5

8

4

 

1

 
 

9

 
 

5

 
 

1

 
 

Next look for a place for 8 and 2. Let’s put them across the center row.

 

9

 

8

5

2

 

1

 
 

Now the 7 must go in the lower right corner, which means 3 goes in the upper left.

3

9

 

8

5

2

 

1

7

   

Now we get another contradiction. Adding across the top, we’d need a 3 in the upper right to make 15, but we’ve already used 3. So this arrangement won’t work. Go back to 9 and 1 in the center column, but now put 8 in the lower right corner, 2 in the upper left.

2

9

 
 

5

 
 

1

8

   

Adding across the top, we need a 4 in the upper right—therefore, need a 6 in lower left.

 

2

9

4

 

5

 

6

1

8

   

This is looking good. The top row adds to 15, and so does the bottom row. Now can we place the 7 and 3 in the two remaining places? Yes! If we put 7 on the left and 3 on the right, our magic square is complete! Every row, column, and diagonal adds up to 15!

2

9

4

7

5

3

6

1

8

   

Now are there any other solutions? Not really. We could flip the square by swapping the top and bottom rows, or by swapping the left and right columns. Or we could rotate the square by 90 degrees, 180 degrees or 270 degrees. In fact there are eight different possibilities, corresponding to four different starting places for the 9 and two different starting boxes for the 8. You can work these out for yourself.

Puzzle 3a

Can we make a magic square using the first nine even numbers: 2, 4, 6, 8, 10, 12, 14, 16, 18? The answer is yes! Each of these numbers is just twice as big as one of the numbers in the first magic square. So if we replace the 9 in the original square by 18, the 8 by 16, and so forth, the rows, columns, and diagonals should all add up to 30. Try it!

Puzzle 3b

This is a little less obvious. Can we make a magic square using the first nine odd numbers: 1, 3, 5, 7, 9, 11, 13, 15, 17? Let’s do a little thought experiment. The 9 is the middle number in the set. If we were to put 9 in the middle square and put 17 and 1 down the center, they would add up to 27. Take the next largest and smallest numbers, 15 and 3. 15 + 3 + 9 = 27! So do 13 + 5 + 9 and 11 + 7 + 9. So we can construct a magic square with all rows and columns adding to 27. You try it.

Puzzle 4

There are many other sets of nine numbers that can form a magic square. In fact, there are an infinite number! For example, multiply each number in the original magic square by the same number, say, 7. Then our numbers will be 7, 14, 21, 28, 35, 42, 49, 56, 63. This will form a magic square with each row, column, and diagonal adding up to 7 x 15, or 105.

But there are even more. Here’s an algebraic proof that you can start with any number and create a series of numbers that all differ from the previous number by a constant. Say our first number is A, and the difference between numbers is N. Our set of numbers is:

A, A + N, A + 2N, A + 3N, A + 4N, A + 5N, A + 6N, A + 7N, A + 8N

   

A + 4N is the 5th, or middle, number. Adding the first, last, and middle numbers, we get:

A + (A + 4N) + (A + 8N) = 3A + 12N.

Adding the second, middle, and next to last, we get:

(A + N) + (A + 4N) + (A + 7N) = 3A + 12N

And so forth. This should make a magic square in which every row, column, and diagonal add up to 3A + 12N.

Check it out.

A+N

A+8N

A+3N

A+6N

A+4N

A+2N

A+5N

A

A+7N

Puzzle 5

So, there are an infinite number of magic squares. Does that mean that all possible sets of nine different numbers can be used for a magic square? It’s easy to prove that’s not the case. For example, take the set of nine even numbers from 2 to 18. These make a magic square adding to 30. Replace one number by an odd number. Suppose we replace the 2 by 1, and keep all the other numbers the same, 4, 6, 8 . . . 18. These numbers cannot form a magic square. Every sum that includes a 1 plus two even numbers will be odd. Every sum that includes three even numbers will be even. Therefore no magic square!

Puzzle 6

Try to form a 4 x 4 magic square using the numbers from 1 to 16. There are many different 4 x 4 magic squares. First it would be good to figure out the sum of each row, column, and diagonal. The sum of all numbers from 1 to 16 is (16 +1) + (15 + 2) + . . . + (8 + 9) = 17 x 8 = 136. (This is a technique for adding a series of numbers—add the two end numbers and work toward the middle.) This would equal the sum of four rows when the magic square is complete, so the sum of any one row is 136 / 4 = 34.

Here is a method for making a 4 x 4 magic square. It is found in a book by Jerome S. Meyer, Fun with Mathematics (World Publishing Company, 1952). First count from 1 to 16 starting at the top left and going across each row in order from left to right.  But write a number in a box only when it lies on a diagonal.

1

   

4

 

6

7

 
 

10

11

 

13

 

 

16

   

Next, start in the first empty square and count down, starting from 15 and entering each number that is not already in the square. The new numbers are in red.

The result is a 4 x 4 magic square, with each row, column, and diagonal adding up to 34. An interesting feature of this square is that numbers in the 2 x 2 squares in each corner also add up to 34.

1

15

14

4

12

6

7

9

8

10

11

5

13

3

2

16

 

Puzzle 7

Is it possible to make a 2 x 2 magic square? Can we prove that it is impossible?

First, let’s try with the numbers 1, 2, 3, and 4. It’s pretty clear that there is no way to arrange these so that they add up to the same number in different directions.

1

2

3

4

Both diagonals add up to 5, but the rows and columns do not. If we make the rows add up to 5, the diagonals and columns don’t.

3

2

1

4

 

Using algebra we can prove that a 2 x 2 magic square is impossible. Suppose we call the four different numbers A, B, C, and D. Then if we could make a magic square, all four rows, columns, and diagonals would add up to the same number, N.

A

B

C

D

We can write six equations, A + B = N, C + D = N, A + C = N, B + D = N, A + D = N, and C + B = N.

Now solve the first equation for A:

A = N – B

If we solve the third equation for A, we get A = N – C. Setting A = A, we get N – C = N – B, in other words, B = C.  This cannot be a magic square because in a magic square all the numbers are different. In fact the only way that all six equations can be true is if A = B = C = D. Definitely not a magic square!