Pandiagonal magic square

A pandiagonal magic square remains pandiagonally magic not only under rotation or reflection, but also if a row or column is moved from one side of the square to the opposite side.

pandiagonal magic square can be regarded as having

It can be shown that non-trivial pandiagonal magic squares of order 3 do not exist.

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.

In addition, the two numbers at the opposite corners of any 3 × 3 square add up to half the magic constant.

Consequently, all 4 × 4 pandiagonal magic squares that are associative must have duplicate cells.

All 4 × 4 pandiagonal magic squares using numbers 1-16 without duplicates are obtained by letting a equal 1; letting b, c, d, and e equal 1, 2, 4, and 8 in some order; and applying some translation.

For example, with b = 1, c = 2, d = 4, and e = 8, we have the magic square The number of 4 × 4 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!

Unlike 4 × 4 pandiagonal magic squares, these can be associative.

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" patterns, which in the above example are: Each of these quincunxes can be translated to other positions in the square by cyclic permutation 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 combinations of the row, column, and diagonal sums.

(corresponding to the 20+2+13+24+6 = 65 example given above), we can add together the following: From this sum, subtract the following: The net result is

Similar linear combinations can be constructed for the other quincunx patterns

No pandiagonal magic square exists of order

But certain sequences of nonconsecutive integers do admit order-(

This sum can be divided in half by taking the appropriate groups of three addends, or in thirds using groups of two addends: An additional equal partitioning of the sum of squares guarantees the semi-bimagic property noted below: 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 A and B, respectively given by: Then

(where C 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: 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.

pandiagonal magic square can be built by the following algorithm.

pandiagonal magic square can be built by the following algorithm.

pandiagonal magic square with this algorithm then every

cells have the same sum as any row and any column of the

rectangle will have the same sum as any row and any column of the

pandiagonal magic square can be built by the following algorithm.

Euler diagram of requirements of some types of 4 × 4 magic squares. Cells of the same colour sum to the magic constant.