Most-perfect magic square
| Most-perfect magic square from|
the Parshvanath Jain temple in Khajuraho
A most-perfect magic square of order n is a magic square containing the numbers 1 to n2 with two additional properties:
- Each 2×2 subsquare sums to 2s, where s = n2 + 1.
- All pairs of integers distant n/2 along a (major) diagonal sum to s.
Specific examples of most-perfect magic squares that begin with the 2015 date demonstrate how theory and computer science are able to define this group of magic squares.   Only a fraction of the 2x2 cell blocks that sum to 130 are accented by the different colored fonts in the 8x8 example.
The 12x12 square below was found by making all the 42 principal reversible squares with ReversibleSquares, running Transform1 2All on all 42, making 23040 of each, (of the 23040 x 23040 total each), then making the most-perfect squares from these with ReversibleMost-Perfect. These squares were then scanned for squares with 20,15 in the proper cells for any of the 8 rotations. The 2015 squares all originated with principal reversible square number #31. This square has values that sum to 35 on opposite sides of the vertical midline in the first two rows.
The image below shows numbers completely surrounded by larger numbers with a blue background.
The Hilbert space filling curve can be divided into 8 cell segments. Each of these segments can be labeled from the beginning of the segment to the end of the segment with the numbers 1 - 8 (b). There are 144 examples of the 8x8 most-perfect magic squares where the 8 cell segments sum to the magic constant of 260 as well as the individual positions in each segment summing to 260. The 1st position is highlighted with a large red font in b) and c) below. The Hilbert curve in a sequential one dimensional representation can be folded and bent into a 2 or 3 dimensional structure. Thus this curve can serve as a Rosetta stone to transition between 2D and 3D magic spaces.
Most-perfect space is defined by a structure where the two dimensional Hilbert space filling curve has these magic sums and all the 2x2 planar subsets have the same sum.
All 64 2x2x2 sub cubes and 192 2x2 subsquares sum to 130 in the cube below. (wrap around 2x2 planar squares included).
All most-perfect magic squares are panmagic squares.
Apart from the trivial case of the first order square, most-perfect magic squares are all of order 4n. In their book, Kathleen Ollerenshaw and David S. Brée give a method of construction and enumeration of all most-perfect magic squares. They also show that there is a one-to-one correspondence between reversible squares and most-perfect magic squares.
For n = 36, there are about 2.7 × 1044 essentially different most-perfect magic squares.
The second property above implies that each pair of the integers with the same background colour in the 4×4 square below have the same sum, and hence any 2 such pairs sum to the magic constant.
- Kathleen Ollerenshaw, David S. Brée: Most-perfect Pandiagonal Magic Squares: Their Construction and Enumeration, Southend-on-Sea : Institute of Mathematics and its Applications, 1998, 186 pages, ISBN 0-905091-06-X
- T.V.Padmakumar, Number Theory and Magic Squares, Sura books, India, 2008, 128 pages, ISBN 978-81-8449-321-4