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)