Most-perfect magic square

Last updated
Magic square at the Parshvanatha temple, Khajuraho.png
transcription of
the indian numerals
Most-perfect magic square from
the Parshvanath Jain temple in Khajuraho

A most-perfect magic square of doubly even order n = 4k is a pan-diagonal magic square containing the numbers 1 to n2 with three additional properties:


  1. Each 2×2 subsquare, including wrap-round, sums to s/k, where s = n(n2 + 1)/2 is the magic sum.
  2. All pairs of integers distant n/2 along any diagonal (major or broken) are complementary (i.e. they sum to n2 + 1).


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. [1]   Only 16 of the 64 2x2 cell blocks that sum to 130 are accented by the different colored fonts in the 8x8 example.

Magic Square 2015.jpeg

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. [2]

Most Perfect 12 x12 Magic Square.png

The 2021 update below shows how the 2x2 cell block sums are preserved in a row / col translation.

12 x 12 2021 most perfect magic square.png


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.

The number of essentially different most-perfect magic squares of order n for 4n = 1, 2, ... form the sequence:

48, 368640, 22295347200, 932242784256000, 144982397807493120000, ... (sequence A051235 in the OEIS ).

For example, there are about 2.7 × 1044 essentially different most-perfect magic squares of order 36.

All order four panmagic squares are most-perfect magic squares. The second property implies that each pair of the integers with the same background color in the 4×4 square below have the same sum, and hence any 2 such pairs sum to the magic constant.


Physical properties

The image below shows areas completely surrounded by larger numbers with a blue background. A water retention topographical model is one example of the physical properties of magic squares. The water retention model progressed from the specific case of the magic square to a more generalized system of random levels. A quite interesting counter-intuitive finding that a random two-level system will retain more water than a random three-level system when the size of the square is greater than 51 X 51 was discovered. This was reported in the Physical Review Letters in 2012 and referenced in the Nature article in 2018. [3] [4]

Most-perfect magic square.jpg


Most-perfect magic cubes

There are 108 of these 2x2 subsquares that have the same sum for the 4x4x4 most-perfect cube. [5]  

Most-perfect magic cube.png

See also


  1. F1 Compiler
  2. Reversible Squares, S. Harry White, 2014
  3. Knecht, Craig; Walter Trump; Daniel ben-Avraham; Robert M. Ziff (2012). "Retention capacity of random surfaces". Physical Review Letters. 108 (4): 045703. arXiv: 1110.6166 . Bibcode:2012PhRvL.108d5703K. doi:10.1103/PhysRevLett.108.045703. PMID   22400865.
  4. OEIS A201126
  5. OEIS A270205

Related Research Articles

Magic square

In 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 diagonals are the same. The integer is the order of the magic square and the constant sum is called the magic constant. If the array includes just the positive integers , the magic square is said to be normal. Some authors take magic square to mean normal magic square.

Magic cube

In mathematics, a magic cube is the 3-dimensional equivalent of a magic square, that is, a number of integers arranged in a n × n × n pattern such that the sums of the numbers on each row, on each column, on each pillar and on each of the four main space diagonals are equal to the same number, the so-called magic constant of the cube, denoted M3(n). It can be shown that if a magic cube consists of the numbers 1, 2, ..., n3, then it has magic constant

In mathematics, a perfect magic cube is a magic cube in which not only the columns, rows, pillars, and main space diagonals, but also the cross section diagonals sum up to the cube's magic constant.

In mathematics, a P-multimagic square is a magic square that remains magic even if all its numbers are replaced by their kth power for 1 ≤ kP. Thus, a magic square is bimagic if it is 2-multimagic, and trimagic if it is 3-multimagic; tetramagic for 4-multimagic; and pentamagic for a 5-multimagic square.

35 (thirty-five) is the natural number following 34 and preceding 36.

1000 or one thousand is the natural number following 999 and preceding 1001. In most English-speaking countries, it is often written with a comma separating the thousands unit: 1,000.

300 is the natural number following 299 and preceding 301.

2000 is a natural number following 1999 and preceding 2001.

126 is the natural number following 125 and preceding 127.

Magic constant

The magic constant or magic sum of a magic square is the sum of numbers in any row, column, or diagonal of the magic square. For example, the magic square shown below has a magic constant of 15. In general where is the side length of the square.

3000 is the natural number following 2999 and preceding 3001. It is the smallest number requiring thirteen letters in English.

4000 is the natural number following 3999 and preceding 4001. It is a decagonal number.

8000 is the natural number following 7999 and preceding 8001.

Kathleen Ollerenshaw English mathematician

Dame Kathleen Mary Ollerenshaw, was a British mathematician and politician who was Lord Mayor of Manchester from 1975 to 1976 and an advisor on educational matters to Margaret Thatcher's government in the 1980s.

Every magic cube may be assigned to one of six magic cube classes, based on the cube characteristics.

A Diagonal Magic Cube is an improvement over the simple magic cube. It is the second of six magic cube classes when ranked by the number of lines summing correctly.

In recreational mathematics, a pandiagonal magic cube is a magic cube with the additional property that all broken diagonals have the same sum as each other. Pandiagonal magic cubes are extensions of diagonal magic cubes and generalize pandiagonal magic squares to three dimensions.

Walter Trump is a German mathematician. He is known for his work in recreational mathematics.

A Nasik magic hypercube is a magic hypercube with the added restriction that all possible lines through each cell sum correctly to where S = the magic constant, m = the order and n = the dimension, of the hypercube.

Water retention on mathematical surfaces

Water retention on mathematical surfaces is the catching of water in ponds on a surface of cells of various heights on a regular array such as a square lattice, where water is rained down on every cell in the system. The boundaries of the system are open and allow water to flow out. Water will be trapped in ponds, and eventually all ponds will fill to their maximum height, with any additional water flowing over spillways and out the boundaries of the system. The problem is to find the amount of water trapped or retained for a given surface. This has been studied extensively for two mathematical surfaces: magic squares and random surfaces. The model can also be applied to the triangular grid.