Magical Squares and Hypercubes - Talk given at the Deutsches Museum,
Munich, August 2000
Peter D. Loly,
Department of Physics and Astronomy, University of Manitoba, Winnipeg,
MB, R3T 2N2.
Email: loly@cc.umanitoba.ca
© P.D.Loly, 2000, 2001 REVISED 29 Jan. 2001, again 5 Feb., 24
April.
The earliest magic square, the 3-by-3 Lo-shu from ancient China, seems
to have arisen in the context of counting the first nine sequential "numbers"
with stones (tokens). Forty five stones are involved and it must have been
have been quite a thrill to have been the first person to discover the
magical properties of this unique arrangement of equal numbers of stones
in each row, column AND diagonal. Dating back some two or more millenia,
it is the smallest magic square, and is unique. This is very early in the
history of mathematics, although we must note that this date is still very
uncertain and subject to much controversy. The earliest drawings use something
resembling "domino" arrangements of dots, while numbers have been used
for the last few centuries:

One usually restricts consideration to the sequence of integers
from 1 to N*N, where N is the dimension, i.e. in the case of N=3,
to 1..9. The magic sum is 15 for the Lo-shu.
[N.B. For some mathematical purposes it is sometimes preferable
to count from 0 to N*N-1, or in the case of N=3, 0..8.]
Terminology
The following classification will be useful (but is not universal):
-
Tiling the plane: repeat the Lo-shu horizontally and vertically
to get a 2-by-2 quartet of Lo-shu's or a 6-by-6 array (which is not magic
because it repeats the first nine integers):
-
Natural Squares: the elements are filled row-by-row (or column-by-column)
with successive integers in the manner in which matrices are stored in
computer programs. Also called "serial" squares.

-
SOMEWHAT NOVEL! Semimagic squares: each row and column gives the
same magic sum. As an example take the "6" near the centre of the quartet
and complete a 3-by-3 square around it. (These squares have sometimes been
called "magic".)
-
Magic squares: in addition to the row and column property, the principal
diagonals also have this same sum.
-
Pandiagonal Magic squares: the smallest are 4-by-4 squares and now,
in addition to the magic square specifications, all the completed parallel
(or split) diagonals have this same sum. (These are often called just "pandiagonal",
which we will see below is unfortunate.)
-
Semi-Pandiagonal: see Heinz & Hendricks p.151
-
Most Perfect Pandiagonal Magic squares: see the book by Ollerenshaw
and Brée.
-
NOVEL! Pandiagonal (non-magic) squares: these do not have the magic
sum of the rows and columns. The smallest example is in fact a 2-by-2
square. Natural squares are trivial examples.
It helps to replicate side-by-side (or tile horizontally) to see
the pandiagonal property.
Parallel to 1-5-9 are 2-6-7 and 3-4-8, and parallel to 3-5-7 are 1-6-8
and 2-4-9.
-
NOVEL! Pandiagonal Semimagic squares: Squares with a combination
with either all row and no column magic sums, or vice versa, together
with the pandiagonal property. [2001]
-
NOVEL! "Logic" Squares (and Hypercubes): These are non-trivial pandiagonal
non-magic squares! [The first has been reported by Loly, J. Rec. Math.
1999 - delayed publication expected in 2001.] These have dimensions of
the powers of two, i.e. 2, 4, 8, 16, etc. A connection may occur with an
important recent book by Ollerenshaw and Brée on "most-perfect
magic squares" having dimensions that are all the multiples of 4, i.e.
4, 8, 12, ...
-
Compound (magic) squares: these are constructed by using a "base"
square and a "frame square". The smallest is constructed from the Lo-shu
template and is 9-by-9; the next is 12-by-12, with either the base square
or the frame square being the Lo-shu, and the other being one of the 880
4-by-4 magic squares. [Expect something somewhat novel in this context
with Wayne Chan in 2001.]
-
Magic Cubes and Hypercubes: Hendricks and others have constructed examples.
For the future there will be cubic and hypercubic counterparts of our newer
varieties of squares.
Square Arrays and Matrices
N.B. All squares may be rotated a quarter turn by multiples of 90 degrees,
and reflected, for a total of 8 versions of the basic square. These are
usually regarded as equivalent, but there are a few confusing statements
in the literature. Also the "dimension" of a magic square in the context
of the linear algebra mathematics of square matrices is simply the number
of elements in a row (or column, or diagonal).
In mathematics, science and engineering 3-by-3 matrices are associated
with three dimensions, e.g. the x,y,z of Cartesian geometry, though the
dimensions need not be spatial, but can more generally represent the number
of degrees of freedom of a system. A 4-by-4 square immediately suggests
four dimensions, and so on for larger squares. Hruska pointed out a connection
between the [1,1,1] eigenvector of the Lo-shu and a NMR problem. More generally
in the context of linear algebra the diagonal eigenvector is related to
row and/or column sums being equal, i.e. semi-magic.
Census of magic squares
2-by-2: no magic, nor semimagic, square, but there is a pandiagonal
non-magic square!
3-by-3: one unique magic square first "found" in China - the
Lo-shu; related to 8 semi-magic squares. The earliest drawing seems to
have used stones or tokens in a 3-by-3 array:
4-by-4: 880 unique squares; 384 semi-pandiagonal; 48
pandiagonal. For the 4-by-4 the 48 most-perfect squares are the same as
most perfect pandiagonal magic squares, but their numbers are not equal
at 8-by-8.
5-by-5: 275,305,224.
6-by-6: exact number has not been counted, but a good scientific
estimate puts the number at about 0.17744*10^20 (the caret notation is
used to effect 10-to-the-power-20). (Pinn & Wierczerkowski used a Monte
Carlo simulated annealing computation at finite temperature and extrapolated
to absolute zero to get the estimate.).
Constructing the first magic square
-
add the numbers 1 to 9 to find 45;
-
divide by 3 to find 15 for the magic sum (per row, column, diagonal);
-
divide 15 by 3 again, or 45 by 9, to find the average number as "5";
-
observe that there are 8 lines of 3 numbers that must add to the magic
sum (3 rows, 3 columns, the main diagonal and the back diagonal);
-
draw these lines without numbers and observe that 4 of the lines provide
the frame of a square, while the other 4 intersect in the middle, forming
an 8-pointed asterisk or double cross of the superposition of a plus sign
(+) and a multiplication sign (x) ;
-
write out 1..9 in a line and connect with lines all the combinations of
3 numbers that sum to 15 (there are exactly eight!!!);
-
observe that 4 of these combinations contain "5" so that these form the
cross;
-
if we take "1" which is a member of one of those 4 lines, it only remains
to see if it should be in a corner, or in the middle of an edge;
-
try both and see which one works;
-
then filling out this magic square is fairly easy.
The symmetries and constraints in this 3-by-3 magic square are remarkable
when examined in detail in the context of the symmetries of a plane square.
There are 8 constaints, the row, column and diagonal sums, and just 8 combinations
of the nine integers that give the same sum (15). It is somewhat easier
to find squares with fewer properties, e.g. eight semimagic squares without
one or both diagonal sums.
It should be clear now as to why there is no 2-by-2 magic square,
and why there are so many (880) 4-by-4 magic squares.
An easy construction for a famous 4-by-4 square
-
Set up a serial square with rows of 4 integers: 1,2,3,4; 5,6,7,8; 9,10,11,12;
13,14,15,16; this is clearly not magic because each row sum is progressively
larger;
-
then invert both diagonals to get a magic square.
Albrecht Dürer's famous woodcut/engraving "MELENCOLIA I" contains
a magic square which is obtained from this one by interchanging the middle
columns. It has the year of his wife's death, 1514, in the bottom row,
and also the day and month!
Constructing larger squares
In the literature you will find systemmatic methods for generating
at least one magic square with a dimension of any odd number, with any
even number, and with any doubly-even number.
Compound Magic Squares
[W. S. Andrews (attribution to ??); Cammann (an ancient Chinese method);
Allan Adler: multiplicative; John Hendricks: composite; Bellew (counting
compound squares)]
The compounding method offers an easy way to construct large (even
humungous) magic squares 9-by-9, 12-by-12, etc.) as combinations of smaller
ones. The only limits are the time, paper and computer power!
Matrix Mathematics and Magic Squares
My colleague, Frank Hruska (Chemistry), drew my attention to the interesting
tridiagonal eigenvector of the Lo-shu magic square. (See reference below.)
It turns out to be a general feature of all magic (and semi-magic squares)
because the generalized diagonal eigenvector is known in the context of
linear algebra to sum the elements of rows (and columns of the transposed
matrix). It is worth introducing, at an untypically early stage, the ideas
of basic matrix multiplication (small numerical squares with row or column
vectors) for an interesting insight into the row and column sums of these
squares. The following diagram should suffice to show how it works for
the Lo-shu in a manner which requires no prior knowledge of matrix multiplication:
| 4 |
9 |
2 |
|
x |
|
4x+9y+2z |
| 3 |
5 |
7 |
* |
y |
= |
3x+5y+7z |
| 8 |
1 |
6 |
|
z |
|
8x+y+6z |
|
4
|
9
|
2
|
|
1
|
|
4+9+2=15
|
|
|
|
1
|
|
3
|
5
|
7
|
*
|
1
|
=
|
3+5+7=15
|
=
|
15
|
*
|
1
|
|
8
|
1
|
6
|
|
1
|
|
8+1+6=15
|
|
|
|
1
|
matrices.htm
< Mma4
(This may stimulate interest in matrix algebra!)
Links to relevant Web pages:
An excellent starting point for school students is found on the Swarthmore
site: Suzanne Alejandre's Magic Square Educational Site: http://forum.swarthmore.edu/alejandre/magic.square.html
A renewed interest in magic squares was rekindled by the 1998 publication
of MOST-PERFECT PANDIAGONAL
MAGIC SQUARES by Kathleen Ollerenshaw [http://www.most-perfect.com/]
and
Dr
David S. Brée http://www.cs.man.ac.uk/~dbree/].
Ollerenshaw's "It All Adds Up" is a short introduction to their ground
breaking work in finding a formula for counting this special class of squares
for any size, a first for any type of magic square.
See a summary by Ian Stewart in Scientific American, November 1999,
122-3.
John Hendricks publishes a number of books and booklets on magic
squares and related topics. His work has been put on two websites, one
in Canada by Harvey
Heinz (together with other pages reached from there: MoreMsqrs; index;
miscnum; magicstar; most-perfect, ...); the other in Europe by Holger
Danielsson , whose site has a number of interesting items as well as:
Ordering
information for John Hendricks publications: Hendricks
Magic Square Lexicon: Illustrated H. D. Heinz & J. R. Hendricks,
2000
One of the most comprehensive lists of magic square pages was
updated
(from time-to-time) by Suzuki: Suzuki
[http://www.pse.che.tohoku.ac.jp/~msuzuki/MagicSquare.html]
|Unfortunately this site has now been discontinued due to
his retirement.
SOME REFERENCES:
Schuyler v. R. Cammann, MAGIC SQUARE, Encyclopedia Britannica, Vol.
14, 1969, 573A-575A, Chicago. N.B. Later editions have a shorter version
of this article missing some important discussion. Other related papers
by Cammann.
Marie-Louise von Franz in "Number and Time: Reflections Leading toward
a Unification of Depth Psychology and Physics", 1974; her later writings
in "Time: Rythym and Repose" and "Psyche and Matter" overlap considerably
with N&T which remains the best account of her (somewhat rambling,
but highly original) thoughts in this arena. Depth Psychology concerns
the unconscious and von Franz has a strongly Jungian outlook, indeed the
work evolved from some notes given to her by Carl Gustave Jung near the
end of his life. Both Jung and von Franz had deep discussions with Wolfgang
Pauli, the discoverer of the (Pauli) Exclusion Principle, for which he
won the Nobel Prize in Physics, the neutrino, and much more besides. Pauli
was one of the greatest contributers to the development of 20th century
physics.
Marcel Granet
"La Pensée Chinoise"
In Scientific American
A column by Ian Stewart in Scientific American (2000) discusses magic
rectangles.