• +44 (0) 208 205 0052
  • info@northlondongrammar.com
  • London, NW9 6HB

How to Solve a Magic Square

Magic squares have grown in popularity with the advent of mathematics-based games like Sudoku. A magic square is an arrangement of numbers in a square in such a way that the sum of each row, column, and diagonal is one constant number, the so-called “magic constant.” This article will tell you how to solve any type of magic square, whether odd-numbered, singly even-numbered, or doubly-even numbered.

Method1

Solving an Odd-Numbered Magic Square

  1. Image titled Solve a Magic Square Step 1
    1
    Calculate the magic constant.[1] You can find this number by using a simple math formula, where n = the number of rows or columns in your magic square. So, for example, in a 3×3 magic square, n = 3. {\displaystyle m=n[(n^{2}+1)/2]}. So, in the example of the 3×3 square:

    • sum = {\displaystyle 3[(9+1)/2]}
    • sum = {\displaystyle 3(10/2)}
    • sum = {\displaystyle 3(5)}
    • sum = 15
    • Hence, the magic constant for a 3×3 square is 15.
    • All rows, columns, and diagonals must add up to this number.
  2. Image titled Solve a Magic Square Step 2
    2
    Place the number 1 in the center box on the top row. This is always where you begin when your magic square has odd-numbered sides, regardless of how large or small that number is. So, if you have a 3×3 square, place the number 1 in Box 2 of the top row; in a 15×15 square, place the number 1 in Box 8 of the top row.
  3. Image titled Solve a Magic Square Step 3
    3
    Fill in the remaining numbers using an up-one, right-one pattern. You will always fill in the numbers sequentially (1, 2, 3, 4, etc.) by moving up one row, then one column to the right. You’ll notice immediately that in order to place the number 2, you’ll move above the top row, off the magic square. That’s okay — although you always work in this up-one, right-one manner, there are three exceptions that also have patterned, predictable rules:

    • If the movement takes you to a “box” above the magic square’s top row, remain in that box’s column, but place the number in the bottom row of that column.
    • If the movement takes you to a “box” to the right of the magic square’s right column, remain in that box’s row, but place the number in the furthest left column of that row.
    • If the movement takes you to a box that is already occupied, go back to the last box that has been filled in, and place the next number directly below it.
Method2

Solving a Singly Even Magic Square

  1. Image titled Solve a Magic Square Step 4
    1
    Understand what a singly even square is. Everyone knows that an even number is divisible by 2, but in magic squares, there are different methodologies for solving singly and doubly even squares.

    • A singly even square has a number of boxes per side that is divisible by 2, but not 4.[2]
    • The smallest possible singly even magic square is 6×6, since 2×2 magic squares can’t be made.
  2. Image titled Solve a Magic Square Step 5
    2
    Calculate the magic constant. Use a similar method to as you would with odd magic squares: {\displaystyle m=[n(n^{2}+1)]/2}, where n = the number of boxes per side. Here the multiplication is done first so as to make calculation easier, the result is the same. So, in the example of a 6×6 square:

    • sum = {\displaystyle [6(62+1)]/2}
    • sum = {\displaystyle [6(36+1)]/2}
    • sum = {\displaystyle (6(37))/2}
    • sum = {\displaystyle 222/2}
    • sum = 111
    • Hence, the magic constant for a 6×6 square is 111.
    • All rows, columns, and diagonals must add up to this number.
  3. Image titled Solve a Magic Square Step 6
    3
    Divide the magic square into four quadrants of equal size. Label them A (top left), C (top right), D (bottom left) and B (bottom right). To figure out how large each square should be, simply divide the number of boxes in each row or column in half.

    • So, for a 6×6 square, each quadrant would be 3×3 boxes.
  4. Image titled Solve a Magic Square Step 7
    4
    Assign each quadrant a number range. Quadrant A gets the first quarter of numbers; Quadrant B the second quarter; Quadrant C the third quarter, and Quadrant D the final quarter of the total number range for the 6×6 magic square. Each quarter should have a range of the total number of squares divided by four, which in this case is {\displaystyle 36/4=9}

    • In the example of a 6×6 square, Quadrant A would be solved with the numbers from 1-9; Quadrant B with 10-18; Quadrant C with 19-27; and Quadrant D with 28-36.
  5. Image titled Solve a Magic Square Step 8
    5
    Solve each quadrant using the methodology for odd-numbered magic squares. Quadrant A will be simple to fill out, as it starts with the number 1, as magic squares usually do. Quadrants B-D, however, will start with strange numbers — 10, 19, and 28, respectively, in our example.

    • Treat the first number of each quadrant as though it is the number one. Place it in the center box on the top row of each quadrant.
    • Treat each quadrant like its own magic square. Even if a box is available in an adjacent quadrant, ignore it and jump to the “exception” rule that fits your situation.
  6. Image titled Solve a Magic Square Step 9
    6
    Create Highlights A and D.[3] If you tried to add up your columns, rows, and diagonals right now, you’d notice that they don’t yet add up to your magic constant. You have to swap some boxes between the top left and bottom left quadrants to finish your magic square. We’ll call those swapped areas Highlight A and Highlight D.

    • Using a pencil, mark all the squares in the top row until you read the median box position of Quadrant A. So, in a 6×6 square, you would only mark Box 1 (which would have the number 8 in it), but in a 10×10 square, you would mark Boxes 1 and 2 (which, in that case, would have the numbers 17 and 24 in them, respectively).
    • Mark out a square using the boxes you just marked as the top row. If you only marked one box, your square is just that one box. We’ll call this area Highlight A-1.
    • So, in a 10×10 magic square, Highlight A-1 would consist of Boxes 1 and 2 in Rows 1 and 2, creating a 2×2 square in the top left of the quadrant.
    • In the row directly below Highlight A-1, skip the number in the first column, then mark as many boxes across as you marked in Highlight A-1. We’ll call this middle row Highlight A-2.
    • Highlight A-3 is a box identical to A-1, but placed in the bottom left corner of the quadrant.
    • Highlight A-1, A-2, and A-3 together comprise Highlight A.
    • Repeat this process in Quadrant D, creating an identical highlighted area called Highlight D.
  7. Image titled Solve a Magic Square Step 10
    7
    Swap Highlights A and D. This is a one-to-one swap; simply lift and replace the boxes between Quadrant A and Quadrant D without changing their order at all. Once you’ve done this, all the rows, columns, and diagonals in your magic square should add up to the magic constant you calculated.
  8. Image titled Solve a Magic Square Step 11
    8
    Do an additional swap for singly even magic squares larger than 6×6. In addition to the swap for quadrants A & D mentioned above, you also need to do a swap for quadrants C & B. Highlight columns from the right side of the square toward the left one less than the number of columns highlighted for highlight A-1. Swap the values in quadrant C with the values in quadrant B for those columns, using the same one-to-one method.

    • Here are two images of a 14×14 Magic Square before and after doing both swaps. Quadrant A swap area is highlighted blue, Quadrant D swap area is highlighted green, Quadrant C swap area is highlighted yellow, and Quadrant B swap area is highlighted orange.
      • 14×14 Magic Square before making swaps (steps 6, 7, & 8)
      • 14×14 Magic Square after making swaps (steps 6, 7, & 8)
Method3

Solving a Doubly Even Magic Square

  1. Image titled Solve a Magic Square Step 11
    1
    Understand what a doubly even square is. A singly even square has a number of boxes per side that’s divisible by 2. A doubly even square has a number of boxes per side divisible by double that — 4.[4]

    • The smallest doubly-even box that can be made is a 4×4 square.
  2. Image titled Solve a Magic Square Step 12
    2
    Calculate the magic constant. Use the same method as you would with odd-numbered or singly-even magic squares: {\displaystyle m=[n(n^{2}+1)]/2}, where n = the number of boxes per side. So, in the example of a 4×4 square:

    • sum = {\displaystyle [4(4^{2}+1)]/2}
    • sum = {\displaystyle [4(16+1)]/2}
    • sum = {\displaystyle (4(17))/2}
    • sum = {\displaystyle 68/2}
    • sum = 34
    • Hence, the magic constant for a 4×4 square is 68/2, or 34.
    • All rows, columns, and diagonals must add up to this number.
  3. Image titled Solve a Magic Square Step 13
    3
    Create Highlights A-D. In each corner of the magic square, mark a mini-square with sides a length of n/4, where n = the length of a side of the whole magic square.[5] Label them Highlights A, B, C, and D in a counter-clockwise manner.

    • In a 4×4 square, you would simply mark the four corner boxes.
    • In an 8×8 square, each Highlight would be a 2×2 area in the corners.
    • In a 12×12 square, each Highlight would be a 3×3 area in the corners, and so on.
  4. Image titled Solve a Magic Square Step 14
    4
    Create the Central Highlight. Mark all the boxes in the center of the magic square in a square area of length n/2, where n = the length of a side of the whole magic square. The Central Highlight should not overlap with Highlights A-D at all, but touch each of them at the corners.

    • In a 4×4 square, the Central Highlight would be a 2×2 area in the center.
    • In an 8×8 square, the Central Highlight would be a 4×4 area in the center, and so on.
  5. Image titled Solve a Magic Square Step 15
    5
    Fill in the magic square, but only in Highlighted areas. Begin filling in the numbers of your magic square from left to right, but only write in the number if the box falls into a Highlight. So, in a 4×4 box, you would fill in the following boxes:

    • 1 in the top-left box and 4 in the top-right box
    • 6 and 7 in the center boxes in Row 2
    • 10 and 11 in the center boxes in Row 3
    • 13 in the bottom-left box and 16 in the bottom-right box.
  6. Image titled Solve a Magic Square Step 16
    6
    Fill in the rest of the magic square by counting backwards. The is essentially the inverse of the previous step. Begin again with the top left box, but this time, skip all boxes that fall in Highlighted area, and fill in non-higlighted boxes by counting backwards. Begin with the largest number in your number range. So, in a 4×4 magic square, you would fill in the following:

    • 15 and 14 in the center boxes in Row 1
    • 12 in the left-most box and 9 in the right-most box in Row 2
    • 8 in the left-most box and 5 in the right-most box in Row 3
    • 3 and 2 in the center boxes in Row 4
    • At this point, all your columns, rows, and diagonals should up to your magic constant you calculated.

    Source : 3 Ways to Solve a Magic Square – wikiHow

Leave a Reply

Your email address will not be published. Required fields are marked *