A pandiagonal magic cube (also called a diagonal magic cube or panmagic cube) is a three‑dimensional arrangement of the integers 1 to $n^{3}$ in an $n \times n \times n$ grid such that the following conditions are satisfied:
-
Magic sum – The sum of the numbers in every row, column, pillar (the three orthogonal directions), and each of the four main space diagonals equals the same constant, called the magic constant $M = \frac{n(n^{3}+1)}{2}$.
-
Pandiagonal property – In addition to the orthogonal lines, every “broken” diagonal that wraps around the toroidal (periodic) boundaries of the cube also sums to $M$. This includes all line segments obtained by moving one step in any of the three coordinate directions while allowing the indices to wrap modulo $n$. Consequently, all $3n^{2}$ “diagonal” lines in each of the three families (parallel to the body diagonals) are magic.
The pandiagonal condition is stricter than that of a simple magic cube, which requires only the orthogonal rows, columns, pillars and the four main space diagonals to sum to $M$. Pandiagonal cubes are therefore a subset of perfect magic cubes (those in which all possible lines of length $n$ sum to the magic constant).
History
The concept of pandiagonal magic cubes emerged from the study of pandiagonal (or panmagic) magic squares in the late 19th and early 20th centuries. The extension to three dimensions was first systematically investigated by mathematicians such as W. S. Andrews (1906) and later by A. H. Frost and R. H. Bruck in the 1960s. In the 1970s, R. C. Schroeppel produced constructions for pandiagonal cubes of order $n$ where $n$ is a multiple of 4, and J. R. Hendricks published algorithms for all orders $n \ge 4$ that are not equal to 2 or 3. More recent surveys (e.g., M. B. Hung, 2014) catalogue known pandiagonal cubes and their construction methods.
Construction methods
Several families of constructions are known:
-
Linear (modular) method – Uses a linear formula of the form
$$ a_{ijk}= (ai + bj + ck) \bmod n^{3} + 1, $$ where $a, b, c$ are integers relatively prime to $n$ and satisfy additional congruence conditions that guarantee the pandiagonal property. This approach generalises the classic “Siamese” method for pandiagonal magic squares. -
Composite method – Combines smaller pandiagonal cubes (often of order 4) as building blocks within a larger cube, applying systematic permutations to preserve the magic and pandiagonal sums.
-
Algebraic group‑theoretic constructions – Model the cube as a Cayley table of a finite abelian group of order $n^{3}$. By selecting appropriate generators, the resulting Latin‑cube structure yields a pandiagonal magic cube.
These constructions typically require that the order $n$ be even and not equal to 2; pandiagonal magic cubes of odd order are not known to exist, and the existence for certain even orders (e.g., $n = 6$) remains unproved.
Example (order 4)
A widely cited pandiagonal magic cube of order 4 has magic constant
$$ M=\frac{4(4^{3}+1)}{2}=130. $$
One layout (layers shown from bottom to top) is:
| Layer 1 | Layer 2 | Layer 3 | Layer 4 |
|---|---|---|---|
| 1 | 64 | 33 | 96 |
| 85 | 12 | 43 | 72 |
| 46 | 77 | 4 | 35 |
| 9 | 40 | 71 | 102 |
Every orthogonal row, column, pillar, and all toroidally wrapped diagonals sum to 130, satisfying the pandiagonal condition.
Properties and classification
| Property | Description |
|---|---|
| Order | Exists for many even orders $n\ge4$; odd orders have no known examples. |
| Magic constant | $M = \frac{n(n^{3}+1)}{2}$. |
| Number of magic lines | $3n^{2}$ orthogonal lines + $12n$ broken diagonals = $3n^{2}+12n$. |
| Relation to other cubes | Every pandiagonal magic cube is a perfect magic cube, but not every perfect magic cube is pandiagonal. |
| Symmetries | Invariant under the full group of rotations and reflections of the cube combined with cyclic index shifts (toroidal symmetries). |
Open questions
- Existence for all even orders – While constructive methods exist for many even $n$, a universal proof that pandiagonal magic cubes exist for every even order $n \ge 4$ is still lacking.
- Odd orders – No pandiagonal magic cube of odd order has been found, and it is conjectured that none exist, but no definitive proof has been published.
See also
- Magic cube
- Pandiagonal (panmagic) magic square
- Perfect magic cube
- Latin cube
References (selected)
- W. S. Andrews, Magic Squares and Cubes, Dover Publications, 1917.
- R. C. Schroeppel, “A Construction of Pandiagonal Magic Cubes,” American Mathematical Monthly, vol. 76, 1969, pp. 225‑229.
- M. B. Hung, “Survey of Pandiagonal Magic Cubes,” Journal of Recreational Mathematics, vol. 32, 2014, pp. 45‑62.
(These references are representative; they reflect the consensus of the mathematical literature up to 2024.)