An associative magic square is an magic square for which
every pair of numbers symmetrically opposite the center
sum to
. Here
is a positive integer
and the entries are the integers 1, 2, ...,
, each used once. The Lo Shu is
associative but not panmagic. The numbers of associative
magic squares, counted up to rotation and reflection,
of order 1, 2, ... are 1, 0, 1, 48, ... (OEIS A081262).
Order four magic squares can be panmagic or associative, but not both. Among nontrivial magic squares, order five magic squares are the smallest which can be both associative and panmagic, and 16 distinct associative panmagic squares exist, one of which is illustrated above (Gardner 1988). The numbers of associative panmagic squares, counted up to rotation and reflection, of order 1, 2, ... are therefore 1, 0, 0, 0, 16, ... (OEIS A081263).
An associative magic square of every positive odd order can be constructed by two rounds of cyclic shifts (Mamzeris
2026, pp. 3-4). Place
in row
and column
, using indices 1, 2, ...,
. First shift each row
cyclically to the left by
positions, then shift each column
cyclically upward by
positions, where
|
(1)
|
The resulting magic square has magic constant .
Equivalently, the entry in column
and row
can be evaluated directly without constructing the other entries
(Mamzeris 2026, pp. 4-5). For
, write
|
(2)
| |||
|
(3)
| |||
|
(4)
|
where
is the common residue of
modulo
, chosen between 0 and
. The first equation reverses the column shift and the second
reverses the row shift. For example,
.