Ora

How to Make an Even Magic Square

Published in Magic Square Construction 5 mins read

Creating an even magic square involves distinct methods depending on whether its order (the number of cells on one side, N) is "doubly-even" or "singly-even." Unlike odd-order squares, which follow a single general construction rule, even-order squares require more specialized techniques.

Understanding Even Magic Square Orders

Even magic squares are categorized based on their order N:

Doubly-Even Order

A magic square has a doubly-even order if its side length N is a multiple of 4.

  • Formula: N = 4k (where k is a positive integer)
  • Examples: Orders 4, 8, 12, 16, etc.

Singly-Even Order

A magic square has a singly-even order if its side length N is an even number that is not a multiple of 4.

  • Formula: N = 4k + 2 (where k is a non-negative integer)
  • Examples: Orders 6, 10, 14, 18, etc. (Note: A 2x2 square is not considered a true magic square as it cannot satisfy the conditions).
Type of Even Magic Square Order (N) Characteristics Construction Complexity
Doubly-Even 4k Multiples of 4 Moderate
Singly-Even 4k + 2 Even, but not multiples of 4 (e.g., 6, 10) High

How to Construct Doubly-Even Magic Squares

Doubly-even magic squares are generally constructed using a "symmetrical exchange" or "cross-out" method. The goal is to swap numbers in specific regions to achieve the magic sum in all rows, columns, and main diagonals.

The magic sum for an N x N magic square is always M = N * (N² + 1) / 2. For a 4x4 square, M = 4 * (4² + 1) / 2 = 34.

Step-by-Step Method (for N = 4k)

  1. Sequential Fill: Fill the N x N grid with numbers sequentially from 1 to in reading order (left-to-right, top-to-bottom).
  2. Identify Swap Regions: For the N x N square, you'll need to identify cells where numbers will be swapped with their complements. A common approach involves visualizing a pattern of cells to keep their original values. For an N x N square, mark cells that are not part of a specific "cross" or "anti-cross" pattern.
    • A simple visual for a 4x4 is to mark cells in the corners and the central 2x2 block to keep their values.
    • Alternatively, mark all cells (i,j) for which both i and j are in (N/4)-aligned blocks (e.g., for N=4, i,j are 0-indexed, if i,j in {0,3} or {1,2}). The specific pattern depends on the algorithm, but the idea is to define regions for swapping.
  3. Perform Swaps: For every number x in the designated "swap" regions (cells that are not part of the 'X' pattern if you consider the "keep" regions as 'X'), replace it with N² + 1 - x. Numbers in the "keep" regions remain unchanged.

Example: Doubly-Even Magic Square (N=4)

Let's construct a 4x4 magic square:

  1. Sequential Fill (1 to 16):

     1   2   3   4
     5   6   7   8
     9  10  11  12
    13  14  15  16
  2. Identify Regions to Keep/Swap: For a 4x4, we'll keep numbers in the corners and the central 2x2 block. The other numbers will be swapped.

    • Keep: (1, 4, 6, 7, 10, 11, 13, 16)
    • Swap: (2, 3, 5, 8, 9, 12, 14, 15)

    Visually, we can define a pattern of cells to keep their original values (K) and cells to swap (S):

    K  S  S  K
    S  K  K  S
    S  K  K  S
    K  S  S  K
  3. Perform Swaps (Value x becomes 17 - x for 'S' cells):

    • 1 (K) -> 1
    • 2 (S) -> 17 - 2 = 15
    • 3 (S) -> 17 - 3 = 14
    • 4 (K) -> 4
    • 5 (S) -> 17 - 5 = 12
    • 6 (K) -> 6
    • 7 (K) -> 7
    • 8 (S) -> 17 - 8 = 9
    • 9 (S) -> 17 - 9 = 8
    • 10 (K) -> 10
    • 11 (K) -> 11
    • 12 (S) -> 17 - 12 = 5
    • 13 (K) -> 13
    • 14 (S) -> 17 - 14 = 3
    • 15 (S) -> 17 - 15 = 2
    • 16 (K) -> 16

    Resulting 4x4 Magic Square:

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

    All rows, columns, and main diagonals sum to 34.

How to Construct Singly-Even Magic Squares

Singly-even magic squares are more challenging to construct than doubly-even ones. A common method, known as Strachey's method or the L-method, involves dividing the square into four smaller odd-order squares, filling them, and then performing specific element exchanges.

The magic sum for an N x N magic square is M = N * (N² + 1) / 2. For a 6x6 square, M = 6 * (6² + 1) / 2 = 111.

Step-by-Step Method (for N = 4k + 2, e.g., N=6)

  1. Divide into Quadrants: Divide the N x N square into four (N/2) x (N/2) sub-squares. Let's call them A (top-left), B (top-right), C (bottom-left), and D (bottom-right).
    • For an N=6 square, you'll have four 3x3 sub-squares.
  2. Fill Quadrants with Odd-Order Logic: Construct an odd-order magic square (e.g., using the Siamese method) for each (N/2) x (N/2) quadrant, but using different number ranges:
    • Quadrant A: Use numbers from 1 to (N/2)².
    • Quadrant B: Use numbers from (N/2)² + 1 to 2 * (N/2)².
    • Quadrant C: Use numbers from 2 * (N/2)² + 1 to 3 * (N/2)².
    • Quadrant D: Use numbers from 3 * (N/2)² + 1 to 4 * (N/2)² (which is ).
      This creates four individual magic squares, but the overall N x N square is not yet magic.
  3. Perform Strategic Exchanges: This is the most complex step and requires precise swaps of elements between the sub-squares, primarily between A and C, and B and D. The exact swaps depend on the value of k in N = 4k + 2.
    • For N = 6 (where k=1), the method involves exchanging cells in the first column of A and C, and a modified exchange in the middle column of A and C.
    • The general pattern involves identifying k columns on the left of A and C, and k-1 columns on the right of B and D, plus a central column (if N/2 is odd) for specific exchanges.
    • Due to the intricate nature of these swaps, it's often best to follow a specific algorithm or tool for the given N. For a detailed walkthrough of the 6x6 (singly-even) construction, refer to comprehensive resources like MathWorld: Magic Square -- Construction or Wikipedia: Magic square -- Construction of singly even magic squares.

Example: Singly-Even Magic Square (N=6)

Constructing a 6x6 magic square is quite involved. Here is a completed 6x6 magic square with a magic sum of 111, illustrating the outcome of Strachey's method:

35   1   6  26  19  24
 3  32  31  29  21   2
30   4   5  23  28  20
 8  10  17  14  16  36
27  22  18  15  13  11
12  25  24   7   9  33

(Note: There are multiple possible 6x6 magic squares, this is one common example.)

Understanding these distinct methods for doubly-even and singly-even orders is key to mastering the construction of all types of even magic squares.