In mathematics, a magic tesseract is the 4-dimensional generalization of a magic square and magic cube, that is, a number of integers arranged in an n x n x n x n pattern such that the sum of the numbers on each pillar (along any axis) as well as the main space diagonals is equal to a single number, the so-called magic constant of the tesseract, denoted M4(n). It can be shown that if a magic tesseract consists of the numbers 1, 2, ..., n4, then it has magic number (Sloane's A021003)

If, in addition, the numbers on every cross section diagonal also sum up to the tesseract's magic number, the tesseract is called a perfect magic tesseract; otherwise, it is called a semiperfect magic tesseract. The number n is called the order of the magic tesseract.

See also