Pandiagonal Magic Squares of Order Five

​
permute 5 × (0 1 2 3 4)
1
× 0
permute 1 × (1 2 3 4 5)
1
× 0
subtract 13
rotate left/right
-2
-1
0
1
2
rotate up/down
-2
-1
0
1
2
1
7
13
19
25
14
20
21
2
8
22
3
9
15
16
10
11
17
23
4
18
24
5
6
12
A magic square has the same sums for the numbers in the rows, columns, and main diagonals. In a pandiagonal magic square, the square can be rotated as if the edges were wrapped around (like a rubber square sheet can be made into a torus), and the main diagonals will still add up to the same magic sum (65 here). All of the 5×5 pandiagonal magic squares can be generated by adding together two sets of permutations.

Details

By one count, there are 3600 order-5 pandiagonal magic squares[1]. If you would like to generate all 275,305,224 order-5 magic squares, try[2].

References

[1] H. Heinz. "Pandiagonal 5×5." (Feb 17, 2016) recmath.org/Magic%20 Squares/pandiag5.htm.
[2] Netstaff Co., Inc. "Magic Squares." (Feb 17, 2016) www.netstaff.co.jp/msq/msqe.htm.

External Links

Fermat's Magic Cube
The Lucas Magic Square
Magic Cube of Order 5
Magic Square (Wolfram MathWorld)
Magic Squares and Designs
Torus (Wolfram MathWorld)

Permanent Citation

Ed Pegg Jr
​
​"Pandiagonal Magic Squares of Order Five"​
​http://demonstrations.wolfram.com/PandiagonalMagicSquaresOfOrderFive/​
​Wolfram Demonstrations Project​
​Published: February 18, 2016