Magic Squares

The 'magic square' is a model with inputs in the grid of squares and outputs in the totals for the rows, columns and diagonals. The rules for one type of magic square:

Magic squares can be solved on paper or in your head but they can also be solved with a spreadsheet.

The magic square model is set up as follows:

  1. Define a grid 3 cells x 3 cells in B3:D5 (you can try 4x4 and 5x5 later)
  2. Select cell B6 and use the S button to get the B column total
  3. Drag the copy marker from B6 through C6 and D6
  4. Select cell E3 and use the S button to get the Row 3 total
  5. Drag the copy marker from E3 through E4 to E5
  6. Select cell E6 and enter '=B3+C4+D5' to get the first diagonal total (use the mouse to select the cells)
  7. Select cell A6 and enter '=B5+C4+D3' to get the second diagonal total.
  8. Format the cells to make a square

You can now enter values to solve a magic square puzzle, for example, use digits 1-9 to make each total equal to 15. You could start with some values which point the way or, for a stiffer challenge, start with an empty grid. You should find it easier to solve the problem with a spreadsheet, changing numbers around, following a strategy, etc. than with paper and pencil. 

Each time you enter a new number the totals are updated automatically so you can see the effects across the whole model of one small change. If the outputs were measurements of wind resistance on the body of a car you could judge the effects of small changes in design on the performance of the whole car. Another example Once the model is set up you can change the values at will and observe the effects. The main difficulty in modelling is finding suitable equations for the process you want to model.

There is a method you can use to enter the values into a magic square. Clear the values in the yellow input squares and follow these steps:

(This also works if you start with 2 or 3 or 4, etc., just keep adding 1. What happens if you add 2 each time, that is 2, 4, 6, etc?)

Create a magic square with starting value 5. What do the total squares hold? What numbers are used to complete it? What is the relationship between the number of values in the sides of a square, the central value and the totals?

When you have found a solution you can draw some conclusions about the nature of magic squares.

  1. How are the numbers arranged around the value in the central square?
  2. How many magic squares are there for the 3x3 grid you have used? What procedure do you use to generate one magic square from another? (Copy and paste the first square and change the values.)

When you have created all possible magic squares answer these questions:

  1. Given a value of 5 in the central square, what combinations of odd and even numbers are required to make the sum values? (Remember that the sum value is odd, 3x5).
  2. Where are the odd and even numbers located in a magic square with 5 in the central square? Why? Can you make a magic square with 5 in the centre that does not follow this pattern?
  3. We have seen that, the central value is 5 in a 3x3 magic square. Can you derive a formula to find the total values for each row and column from the order of the square, 3? We know it is 15 so what formula will work? The same formula should work for magic squares of order 4, 5, 6 etc.

Create a 5x5 magic square using numbers 1-25. What goes in the middle? Use the method above to complete it.

Create a 4x4 magic square using numbers 1-16. There is no central square so we apply a rule to the middle 4 - what rule will this be? How do we derive the sum of these squares?

More Magic Squares.

Use the Back Button to Return to the previous page