A panmagic square is a magic square of order in which every diagonal
of
entries, including those obtained by wrapping around the edges, sums to the magic
constant (Kraitchik 1942, pp. 143 and 189-191). (Only the rows, columns,
and main diagonals must sum to the same magic
constant for the usual type of magic square.)
The terms diabolic square (Gardner 1961, pp. 135-137; Hunter and Madachy 1975,
p. 24; Madachy 1979, p. 87), pandiagonal square (Hunter and Madachy 1975,
p. 24), and Nasik square (Madachy 1979, p. 87) are sometimes also used.
For normal magic squares, which use the integers 1 through
exactly once, no panmagic square exists of order 3 or any positive order
with
an integer. The Siamese method
for generating magic squares produces panmagic squares
for orders
with ordinary vector
and break vector (1,
).
The Lo Shu is not panmagic, but it is an associative magic square. Normal magic squares of order four can be panmagic or associative, but not both. Normal magic squares of order five are the smallest that can be both associative and panmagic, and 16 distinct associative panmagic squares exist up to rotation and reflection, one of which is illustrated above (Gardner 1988).
The numbers of normal panmagic squares up to rotation and reflection, for orders 1, 2, ..., are 1, 0, 0,
48, 3600, ... (OEIS A027567). Here, the count
of
squares (all 48 of which are illustrated above) corrects Hunter and Madachy (1975,
pp. 24-25), who cite the total number of
squares 384, counting rotations
and reflections separately.
It is difficult to construct a square that is both bimagic and panmagic. Tarry found an example with nonconsecutive integers
in 1903. Su Maoting, an automobile transport worker in the Fujian province of China,
found a
example in February 2006 (Boyer 2006).
Panmagic squares are related to hypercubes.