Most-perfect squares are pandiagonal magic squares that are compact and complete.

There are most-perfect squares for all doubly even orders.

Most-perfectSquares makes these squares. Most-perfect8 makes all the order 8 most-perfect squares.

The complementary pairs are shown as (**a**,**a**),
(**b**,**b**), etc.:

These are the 2x2 blocks, (each summing to 34):

Ollerenshaw and Brée established a one-to-one correspondence between most-perfect magic squares and reversible squares. They also developed formulas for computing the number of reversible squares, so the number of most-perfect magic squares can be determined for any order. See A051235.

ReversibleMost-perfect transforms reversible squares to and from most-perfect squares. See notes.

Most-perfect squares of order 8k can be transformed to Franklin magic squares.

The loly_paper gives a transform, (I), for order 8:

- swap rows (3,5) and columns (3,5)
- swap rows (4,6) and columns (4,6)

This paper established that for order 8 Franklin magic squares:

- there are none that are most-perfect
- transform I makes all of them from the most-perfect squares

This can be shown algebraically. See derivation.

To see the effect of these transforms it may be helpful to look at the bones format and the 2x2 subsquares aligned at the square sides. For most-perfect squares these subsquares, distant n/2 diagonally, are complementary. See note. These are labelled (a,A), (b,B), etc. Here is an order 8 most-perfect square .txt, and the Franklin from transform I .txt:

Notice that the complementary 2x2s are now adjacent corner paired, with the result that each quarter of the square consists of 2 subsquares and their complements. This gives the required half row and half column sums; and makes each quarter of the square pandiagonal while leaving the full square pandiagonal. See detail.

Because each row, column is swapped only once:

- the order of swapping is not important
- the transform is its own reverse, i.e., applied to the Franklin square it re-creates the most-perfect square

An alternate transform, (Ia), is: swap rows/columns (1,7), (2,8). This transform will not make more Franklin magic squares. Applied to all the most-perfect squares, transform Ia also makes all the Franklin magic squares, (in different order and with different aspects than transform I). For transform Ia, the main \diagonal 2x2 pattern is DdAa.

For order 16 there are many more Franklin magic squares than most-perfect squares:

- there are many simple transforms, (swapping rows/columns), that make distinct patterns of Franklin magic squares from most-perfect squares
- there are other Franklin magic squares that cannot be made by these simple transforms: example
- some most-perfect squares are already Franklin magic squares: example

Here is an order 16 most-perfect square .txt:

This transform of the most-perfect square is: swap rows/columns (3,9), (4,10), (7,13), (8,14) .txt

As with the order 8, the complementary 2x2s are now adjacent corner paired in the same quarter of the square resulting in the requisite sums. See detail.

This transform of the most-perfect square is: swap rows/columns (5,9), (6,10), (7,11), (8,12) .txt

With transform II the complementary 2x2s are interleaved, i.e., there is one other 2x2 separating each complementary pair. They are still on diagonals in the same quarter of the square, giving the required sums. See detail.

This transform of the most-perfect square is: swap rows/columns (5,11), (6,12), (7,9), (8,10) .txt

With transform III two complementary 2x2s are nested in the other two complementary 2x2s of the diagonals of each quarter. Again, the required sums result. See detail.

Other transforms can extend the above, making hybrids of the main \diagonals:

- Transform IV: transform I plus swap rows/columns (11,13), (12,14)
- hybrid of transforms I and II .txt
- Transform V: transform IV plus swap rows/columns (9,11), (10,12)
- hybrid of transforms I and III .txt
- Transform VI: transform II plus swap rows/columns (9,11), (10,12)
- hybrid of transforms II and III .txt

These also make Franklin magic squares.

Here is a Franklin magic square, (Hurkens, Figure 6), that cannot be made by swapping rows/columns of a most-perfect square: .txt

Now subsquare 'a' and its complement 'A' are both in columns 1,2. But, any transform that moves subsquare 'A' from columns 9,10 of the most-perfect square to columns 1,2 moves subsquare 'a' from columns 1,2 to columns 9,10.

Subsquare 'A' is here inverted to 'A_{6}', (rotation 6 of program
Rotate).

The number of simple transform combinations increases with each 8k order, (24, 32, ..).

Heinz, Harvey "Most-perfect Magic Squares" http://recmath.org/Magic%20Squares/most-perfect.htm

"Most-Perfect Magic Squares" http://recmath.org/Magic%20Squares/most-perfect.htm

Ollerenshaw, Kathleen and David S. Brée
"Most-perfect Pandiagonal Magic Squares"

http://www.agnesscott.edu/lriddle/women/abstracts/ollerenshaw_mostperfect.htm

Order form at
Institute of mathematics & its applications.

Riddle, Larry "Dame Kathleen Timpson Ollerenshaw" http://www.agnesscott.edu/lriddle/women/ollerenshaw.htm

Stewart, Ian "Most-Perfect Magic Squares" http://www.klassikpoez.narod.ru/mk/122-123.pdf