Wednesday, August 4, 2010

The Magic Square

This is one I come back to when I'm bored and all I have is pen and paper.  I also read in a biography of Benjamin Franklin that he used to do this when he was stuck in boring meetings.  Construct a 3x3 grid of numbers, using numbers 1 through 9, and arrange the numbers in the square such that every row, column, and diagonal (diagonals through the center) adds up to 15. 

Too easy?  Now construct a 4x4 grid made out of numbers 1 through 16, such that every row, column, and diagonal adds up to 34.  This one is killing me because I figured it out once, but can't seem to rediscover the solution.  There are ways to do this for grids 5x5, 6x6, and up, though they no doubt get very difficult.

One solution to the 3x3 square is below.  There are other solutions that are simply rotations of this one - can you find a solution that is not a rotation of the square below?  As for the 4x4 square, I'm still trying to figure it out. 


  1. My entire extended family saw me trying to do this and each grabbed a pencil and paper hoping to be the first to figure it out. Far too much fun.

    Now on to the 4x4!

  2. Here's the answer:

    8 1 6
    3 5 7
    4 9 2

    (The trick is to begin with solution & placement for 7)

  3. reflections would also work!

  4. A simple pattern exits for an odd number magic squares. Think of the grid as if the vertical columns left and right were adjacent to each other. and the horizontal rows top and bottom were also adjacent to each other. Start on an outside edge and place the digit 1in the middle of the row or column you selected. move diagonally to the next square outside the grid. Use the idea that the rows and columns are beside each other and go to the position on the opposite side. For example following the 816 357 492 example above , 1 is in the top row center. 2 is up one row (go to the bottom row) and right one column. 3 is up one row and right one column which takes you off the square so back to the most left column. For 4 a up one row and right one column would place you in the square taken by 1. The rule is drop down a square and put the 4 in that square, then resume your diagonal action for 5, then for 6. Another diagonal would put you in the square 4 is currently in, so use the drop down rule for 7. diagonal takes you to the opposite column for 8 and the next diagonal takes you to the opposite row for 9. Every odd numbered magic squares I have seen always has one center diagonal with the middle number in the center and all the numbers above and below it ordered from corner to corner like the 456 above.
    I have no clue if a pattern exists for even numbered squares

  5. 16 11 1 8
    10 4 7 15
    3 6 14 9
    5 13 12 2

    Diagonal end up giving 26!! What is the solution? Is there any trick?