# Magic cube classes

In mathematics, a magic cube of order $n$ is an $n\times n\times n$ grid of natural numbers satisying the property that the numbers in the same row, the same column, the same pillar or the same length-$n$ diagonal add up to the same number. It is a $3$-dimensional generalisation of the magic square. A magic cube can be assigned to one of six magic cube classes, based on the cube characteristics. A benefit of this classification is that it is consistent for all orders and all dimensions of magic hypercubes.

## The six classes

* Simple:
The minimum requirements for a magic cube are: all rows, columns, pillars, and 4 space diagonals must sum to the same value. A simple magic cube contains no magic squares or not enough to qualify for the next class. The smallest normal simple magic cube is order 3. Minimum correct summations required = 3m$^2$ + 4
* Diagonal:
Each of the 3m planar arrays must be a simple magic square. The 6 oblique squares are also simple magic. The smallest normal diagonal magic cube is order 5. These squares were referred to as 'Perfect' by Gardner and others. At the same time he referred to Langman’s 1962 pandiagonal cube also as 'Perfect'. Christian Boyer and Walter Trump now consider this and the next two classes to be Perfect. (See Alternate Perfect below). A. H. Frost referred to all but the simple class as Nasik cubes. The smallest normal diagonal magic cube is order 5; see Diagonal magic cube. Minimum correct summations required = 3m$^2$ + 6m + 4
* Pantriagonal:
All 4m$^2$ pantriagonals must sum correctly (that is 4 one-segment, 12(m−1) two-segment, and 4(m−2)(m−1) three-segment). There may be some simple AND/OR pandiagonal magic squares, but not enough to satisfy any other classification. The smallest normal pantriagonal magic cube is order 4; see Pantriagonal magic cube. Minimum correct summations required = 7m$^2$. All pan-r-agonals sum correctly for r = 1 and 3.
* PantriagDiag:
A cube of this class was first constructed in late 2004 by Mitsutoshi Nakamura. This cube is a combination pantriagonal magic cube and diagonal magic cube. Therefore, all main and broken space diagonals sum correctly, and it contains 3m planar simple magic squares. In addition, all 6 oblique squares are pandiagonal magic squares. The only such cube constructed so far is order 8. It is not known what other orders are possible; see Pantriagdiag magic cube. Minimum correct summations required = 7m$^2$ + 6m
* Pandiagonal:
All 3m planar arrays must be pandiagonal magic squares. The 6 oblique squares are always magic (usually simple magic). Several of them may be pandiagonal magic. Gardner also called this (Langman’s pandiagonal) a 'perfect' cube, presumably not realizing it was a higher class then Myer’s cube. See previous note re Boyer and Trump. The smallest normal pandiagonal magic cube is order 7; see Pandiagonal magic cube. Minimum correct summations required = 9m$^2$ + 4. All pan-r-agonals sum correctly for r = 1 and 2.
* Perfect:
All 3m planar arrays must be pandiagonal magic squares. In addition, all pantriagonals must sum correctly. These two conditions combine to provide a total of 9m pandiagonal magic squares. The smallest normal perfect magic cube is order 8; see Perfect magic cube.
Nasik; A. H. Frost (1866) referred to all but the simple magic cube as Nasik! C. Planck (1905) redefined Nasik to mean magic hypercubes of any order or dimension in which all possible lines summed correctly. i.e. Nasik is a preferred alternate, and less ambiguous term for the perfect class. Minimum correct summations required = 13m$^2$. All pan-r-agonals sum correctly for r = 1, 2 and 3.
Alternate Perfect Note that the above is a relatively new definition of perfect. Until about 1995 there was much confusion about what constituted a perfect magic cube (see the discussion under Diagonal). Included below are references and links to discussions of the old definition With the popularity of personal computers it became easier to examine the finer details of magic cubes. Also more and more work was being done with higher-dimension magic hypercubes. For example, John Hendricks constructed the world's first Nasik magic tesseract in 2000. Classed as a perfect magic tesseract by Hendricks definition.

## Generalized for all dimensions

A magic hypercube of dimension n is perfect if all pan-n-agonals sum correctly. Then all lower-dimension hypercubes contained in it are also perfect. For dimension 2, The Pandiagonal Magic Square has been called perfect for many years. This is consistent with the perfect (Nasik) definitions given above for the cube. In this dimension, there is no ambiguity because there are only two classes of magic square, simple and perfect.
In the case of 4 dimensions, the magic tesseract, Mitsutoshi Nakamura has determined that there are 18 classes. He has determined their characteristics and constructed examples of each. And in this dimension also, the Perfect (Nasik) magic tesseract has all possible lines summing correctly and all cubes and squares contained in it are also Nasik magic.

## Another definition and a table

Proper: A proper magic cube is a magic cube belonging to one of the six classes of magic cube, but containing exactly the minimum requirements for that class of cube. i.e. a proper simple or pantriagonal magic cube would contain no magic squares, a proper diagonal magic cube would contain exactly 3m + 6 simple magic squares, etc. This term was coined by Mitsutoshi Nakamura in April, 2004.
Minimum lines (and magic squares) required for each class of magic cube :
| Class of magic cube | Smallest possible order | Lines summing correctly to S (m(m$^3$+1)) / 2 | Lines summing correctly to S (m(m$^3$+1)) / 2 | Lines summing correctly to S (m(m$^3$+1)) / 2 | Lines summing correctly to S (m(m$^3$+1)) / 2 | Simple magic squares | Simple magic squares | Pandiagonal (Nasik) magic squares | Pandiagonal (Nasik) magic squares |
| (r-agonal) | | Ortho. 1 | Diag. 2 | Triag. 3 | Total | Planar | Oblique | Planar | Unique |
| Simple | 3 | 3m$^2$ | — | 4 | 3m$^2$ + 4 | — | — | — | — |
| Diagonal | 5 | 3m$^2$ | 6m | 4 | 3m$^2$ + 6m + 4 | 3m | 6 | — | — |
| Pantriagonal | 4 | 3m$^2$ | — | 4m$^2$ | 7m$^2$ | — | — | — | — |
| PantriagDiag | 8 ? | 3m$^2$ | 6m | 4m$^2$ | 7m$^2$ + 6m | 3m | 0 | — | 6 |
| Pandiagonal | 7 | 3m$^2$ | 6m$^2$ | 4 | 9m$^2$ + 4 | — | 6 | 3m | — |
| Perfect (Nasik) | 8 | 3m$^2$ | 6m$^2$ | 4m$^2$ | 13m$^2$ | — | — | 3m | 6m |
Notes for the table
* For the diagonal or pandiagonal classes, one or possibly 2 of the 6 oblique magic squares may be pandiagonal magic. All but 6 of the oblique squares are 'broken'. This is analogous to the broken diagonals in a pandiagonal magic square. i.e. Broken diagonals are 1-D in a 2-D square; broken oblique squares are 2-D in a 3-D cube.
* The table shows the minimum lines or squares required for each class (i.e. proper). Usually there are more, but not enough of one type to qualify for the next class.