If all the diagonals--including those obtained by "wrapping around" the edges--of a magic square sum to the same magic constant, the square is said to be a panmagic square (Kraitchik 1942, pp. 143 and 189-191). (Only the rows, columns, and main diagonals must sum to the same constant for the usual type of magic square.) The terms diabolic square (Gardner 1961, pp. 135-137; Hunter and Madachy 1975, p. 24; Madachy 1979, p. 87), pandiagonal square (Hunter and Madachy 1975, p. 24), and Nasik square (Madachy 1979, p. 87) are sometimes also used.
No panmagic squares exist of order 3 or any order for an integer. The Siamese method for generating magic squares produces panmagic squares for orders with ordinary vector (2, 1) and break vector (1, ).
The Lo Shu is not panmagic, but it is an associative magic square. Order four squares can be panmagic or associative, but not both. Order five squares are the smallest which can be both associative and panmagic, and 16 distinct associative panmagic squares exist, one of which is illustrated above (Gardner 1988).
The number of distinct panmagic squares of order 1, 2, ... are 1, 0, 0, 48, 3600, ... (OEIS A027567). Here, the count of squares (all 48 of which are illustrated above) corrects Hunter and Madachy (1975, pp. 24-25), who cite the total number of squares 384 instead of the number of distinct such squares.
It is difficult to construct a square that is both bimagic and panmagic. Tarry found an example with nonconsecutive integers in 1903. In February 2006, Su Maoting, an automobile transport worker in the Fujian province of China, managed to find a example of a bimagic panmagic square.
Panmagic squares are related to hypercubes.