A pandiagonal magic square or panmagic square (also diabolic square, diabolical square or diabolical magic square) is a
magic square
In mathematics, especially History of mathematics, historical and recreational mathematics, a square array of numbers, usually positive integers, is called a magic square if the sums of the numbers in each row, each column, and both main diago ...
with the additional property that the
broken diagonals, i.e. the diagonals that wrap round at the edges of the square, also add up to the
magic constant.
A pandiagonal magic square remains pandiagonally magic not only under
rotation
Rotation or rotational/rotary motion is the circular movement of an object around a central line, known as an ''axis of rotation''. A plane figure can rotate in either a clockwise or counterclockwise sense around a perpendicular axis intersect ...
or
reflection, but also if a row or column is
moved from one side of the square to the opposite side. As such, an
pandiagonal magic square can be regarded as having
orientations.
3×3 pandiagonal magic squares
It can be shown that
non-trivial
In mathematics, the adjective trivial is often used to refer to a claim or a case which can be readily obtained from context, or a particularly simple object possessing a given structure (e.g., group, topological space). The noun triviality usual ...
pandiagonal magic squares of order 3 do not exist. Suppose the square
:
is pandiagonally magic with magic constant . Adding sums and results in . Subtracting and we get
However, if we move the third column in front and perform the same argument, we obtain . In fact, using the
symmetries of 3 × 3 magic squares, all cells must equal . Therefore, all 3 × 3 pandiagonal magic squares must be trivial.
However, if the magic square concept is generalized to include geometric shapes instead of numbers – the
geometric magic squares discovered by
Lee Sallows – a 3 × 3 pandiagonal magic square does exist.
4×4 pandiagonal magic squares

The smallest non-trivial pandiagonal magic squares are 44 squares. All 44 pandiagonal magic squares must be
translationally symmetric to the form
Since each 22 subsquare sums to the magic constant, 44 pandiagonal magic squares are
most-perfect magic squares. In addition, the two numbers at the opposite corners of any 33 square add up to half the magic constant. Consequently, all 44 pandiagonal magic squares that are
associative
In mathematics, the associative property is a property of some binary operations that rearranging the parentheses in an expression will not change the result. In propositional logic, associativity is a valid rule of replacement for express ...
must have duplicate cells.
All 44 pandiagonal magic squares using numbers 1-16 without duplicates are obtained by letting equal 1; letting , , , and equal 1, 2, 4, and 8 in some order; and applying some
translation
Translation is the communication of the semantics, meaning of a #Source and target languages, source-language text by means of an Dynamic and formal equivalence, equivalent #Source and target languages, target-language text. The English la ...
. For example, with , , , and , we have the magic square
The number of 44 pandiagonal magic squares using numbers 1-16 without duplicates is 384 (16 times 24, where 16 accounts for the translation and 24 accounts for the 4
! ways to assign 1, 2, 4, and 8 to , , , and ).
5×5 pandiagonal magic squares
There are many 5 × 5 pandiagonal magic squares. Unlike 4 × 4 pandiagonal magic squares, these can be
associative
In mathematics, the associative property is a property of some binary operations that rearranging the parentheses in an expression will not change the result. In propositional logic, associativity is a valid rule of replacement for express ...
. The following is a 5 × 5 associative pandiagonal magic square:
In addition to the rows, columns, and diagonals, a 5 × 5 pandiagonal magic square also shows its magic constant in four "
quincunx
A quincunx ( ) is a geometry, geometric pattern consisting of five points arranged in a cross, with four of them forming a Square (geometry), square or rectangle and a fifth at its center. The same pattern has other names, including "in saltire" ...
" patterns, which in the above example are:
: 17+25+13+1+9 = 65 (center plus adjacent row and column squares)
: 21+7+13+19+5 = 65 (center plus the remaining row and column squares)
: 4+10+13+16+22 = 65 (center plus diagonally adjacent squares)
: 20+2+13+24+6 = 65 (center plus the remaining squares on its diagonals)
Each of these quincunxes can be translated to other positions in the square by
cyclic permutation
In mathematics, and in particular in group theory, a cyclic permutation is a permutation consisting of a single cycle. In some cases, cyclic permutations are referred to as cycles; if a cyclic permutation has ''k'' elements, it may be called a ''k ...
of the rows and columns (wrapping around), which in a pandiagonal magic square does not affect the equality of the magic constants. This leads to 100 quincunx sums, including broken quincunxes analogous to broken diagonals.
The quincunx sums can be proved by taking
linear combination
In mathematics, a linear combination or superposition is an Expression (mathematics), expression constructed from a Set (mathematics), set of terms by multiplying each term by a constant and adding the results (e.g. a linear combination of ''x'' a ...
s of the row, column, and diagonal sums. Consider the pandiagonal magic square
:
with magic constant . To prove the quincunx sum
(corresponding to the 20+2+13+24+6 = 65 example given above), we can add together the following:
: 3 times each of the diagonal sums
and
,
: The diagonal sums
,
,
, and
,
: The row sums
and
.
From this sum, subtract the following:
: The row sums
and
,
: The column sum
,
: Twice each of the column sums
and
.
The net result is
, which divided by 5 gives the quincunx sum. Similar linear combinations can be constructed for the other quincunx patterns
,
, and
.
(4''n''+2)×(4''n''+2) pandiagonal magic squares with nonconsecutive elements
No pandiagonal magic square exists of order
if consecutive
integer
An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
s are used. But certain sequences of nonconsecutive integers do admit order-(
) pandiagonal magic squares.
Consider the sum 1+2+3+5+6+7 = 24. This sum can be divided in half by taking the appropriate groups of three addends, or in thirds using groups of two addends:
: 1+5+6 = 2+3+7 = 12
: 1+7 = 2+6 = 3+5 = 8
An additional equal partitioning of the sum of squares guarantees the semi-bimagic property noted below:
: 1
2 + 5
2 + 6
2 = 2
2 + 3
2 + 7
2 = 62
Note that the consecutive integer sum 1+2+3+4+5+6 = 21, an
odd sum, lacks the half-partitioning.
With both equal partitions available, the numbers 1, 2, 3, 5, 6, 7 can be arranged into 6 × 6 pandigonal patterns and , respectively given by:
Then
(where is the magic square with 1 for all cells) gives the nonconsecutive pandiagonal 6 × 6 square:
with a maximum element of 49 and a pandiagonal magic constant of 150.
This square is pandiagonal and semi-bimagic, that means that
rows, columns, main diagonals and broken diagonals have a sum of 150 and, if we square all the numbers in the square, only the rows and the columns are magic and have a sum of 5150.
For 10th order a similar construction is possible using the equal partitionings of the sum 1+2+3+4+5+9+10+11+12+13 = 70:
: 1+3+9+10+12 = 2+4+5+11+13 = 35
: 1+13 = 2+12 = 3+11 = 4+10 = 5+9 = 14
: 1
2 + 3
2 + 9
2 + 10
2 + 12
2 = 2
2 + 4
2 + 5
2 + 11
2 + 13
2 = 335 (equal partitioning of squares; semi-bimagic property)
This leads to squares having a maximum element of 169 and a pandiagonal magic constant of 850, which are also semi-bimagic with each row or column sum of squares equal to 102,850.
(6''n''±1)×(6''n''±1) pandiagonal magic squares
A
pandiagonal magic square can be built by the following algorithm.
4''n''×4''n'' pandiagonal magic squares
A
pandiagonal magic square can be built by the following algorithm.
If we build a
pandiagonal magic square with this algorithm then every
square in the
square will have the same sum. Therefore, many symmetric patterns of
cells have the same sum as any row and any column of the
square. Especially each
and each
rectangle will have the same sum as any row and any column of the
square. The
square is also a
most-perfect magic square.
(6''n''+3)×(6''n''+3) pandiagonal magic squares
A
pandiagonal magic square can be built by the following algorithm.
References
* W. S. Andrews, ''Magic Squares and Cubes''. New York: Dover, 1960. Originally printed in 1917. See especially Chapter X.
* Ollerenshaw, K., Brée, D.: ''Most-perfect pandiagonal magic squares.'' IMA, Southend-on-Sea (1998)
External links
Panmagic Square at MathWorld* http://www.azspcs.net/Contest/PandiagonalMagicSquares
{{DEFAULTSORT:Panmagic Square
Magic squares