Magic Squares
A magic square is an n x n grid in which numbers have been written in such a way that the sum of the numbers along any row, column, or main diagonal is always the same magic constant. In a pure magic square, the numbers in the grid must be the consecutive integers from one to n2 with each number used exactly once. The number n is called the order of the square. The unique order 3 magic square was known in China at least by 500 BC where it is called the lo shu.
Most literature on magic squares is about how to construct magic squares in general and those with special properties. A magic square in which all broken diagonals add up to the magic constant is called pandiagonal. A magic square in which cells that are situated directly opposite from the center is called associative. The smallest magic squares that are both pandiagonal and associative have order 5. Here is one.
If all the numbers in a magic square are squared and the result is a magic square, the square is called bi-magic. Here is one.
Martin Gardner has offered $100 prize money to first person who can find an order 3 magic square whose entries are all different perfect squares or prove that none can exist. If all the numbers in a magic square are prime, the square is called prime-magic. Here is an order 3 magic square containing consecutive primes:
It is standard not to count rotations and reflections when counting magic squares. Accordingly, there is only one magic square of order 1 or order 3. There are none of order 2. All 880 magic squares of order 4 were first enumerated by Bernard Frenicle de Bessy in 1693. In 1973, Richard Schroeppel developed a computer program to enumerate all order 5 magic squares. After 100 hours, the computer found all 275,305,224 of them. Pinn and Wieczerkowski used Monte Carlo simulation and methods from statistical mechanics to estimate that the number of order 6 magic squares is between 1.7766 x 1019 and 1.7743 x 1019.
There are different methods for constructing magic squares, but all of them depend on whether the order of the square to be constructed is odd, even but not divisible by four, or divisible by four. William Andrews gave the following method for constructing odd-order magic squares in his pioneering book Magic Squares and Cubes (1917).
First, imagine that the top edge of the square is attached to the bottom edge so that if one moves up from the top edge, one arrives at the bottom edge. Similarly, imagine the right edge is attached to the left edge. Now, start in the middle top square and write a number 1. Move up one and to the right one and write a number 2. Next, move up one and to the right one and write a number 3. Continue in this manner unless your path is blocked. In the above picture, this first happens after writing the number 5. In this situation, move down one and write the next number. Then continue as before, moving up one and to the right one and writing down the next number. After n2 steps, you have a magic square.
In recent times, Allen Adler has developed a way to "multiply" magic squares. For example, let A be the 3x3 magic square below and let B be the 4x4 magic square.
A*B is defined to be the square shown below:
It is formed in this way. First draw an empty 4x4 square. Find where the number 1 is on B. In this case, it is the top left corner. Place a copy of A in this corner square. Now find where the number 2 is on B. In this square place a copy of A but add 9 to all its numbers. In the square where the number 3 is on B, place a copy of A and add two times 9, or 18, to all its numbers, and so on. At each cell where a number x was on B, a copy of A with 9 times x-1 added to all its numbers is placed. The result is a 12x12 magic square. Adler proved that this operation is associative, that is if A, B, and C are any magic squares then (A*B)*C = A*(B*C). It is not commutative however. In the example, A*B does not equal B*A. The 1x1 magic square with a number 1 in its only square is denoted by I. It has the property that A*I = I*A = A for any magic square A. If a magic square C = A*B and neither A nor B is equal to I, then C is called "composite" in analogy with the integers. If P is a magic square that is not composite, it is called prime. If C is any magic square then there are prime magic squares P1, P2..., Pn such that C = P1*P2*...*Pn. Adler proved in 1992 that if Q1,..,Qm are primes and C = Q1*Q2*...*Qm also, then m=n and Qi = Pi for every I.
In 1998, Kathleen Ollerenshaw and David Brée's Most-Perfect Pandiagonal Magic Squares was published. In this work, the authors give a method for constructing all most-perfect pandiagonal magic squares. This type of pandiagonal magic square has the property that every 2x2 subsquare adds up to 2(n2 - 1) and every pair of squares that are n/2 squares apart along a diagonal sum up to n2 - 1. Its been known for a century, that any most-perfect pandiagonal magic square's order is divisible by 4. They prove a formula for the number of most-perfect pandiagonal squares. For order 4 the number is 48. For order 8, it is 368,640. For order 32, there are 6 X 1037. Their accomplishment marks the first complete classification of any type of magic square with orders greater than 5.
This is the complete article, containing 980 words
(approx. 3 pages at 300 words per page).