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):

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

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

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.