Magic cube
In mathematics, a magic cube is the 3-dimensional equivalent of a magic square, that is, a collection of integers arranged in an n × n × n pattern such that the sums of the numbers on each row, on each column, on each pillar and on each of the four main space diagonals are equal, the so-called magic constant of the cube, denoted M3(n). If a magic cube consists of the numbers 1, 2, ..., n3, then it has magic constant (sequence A027441 in the OEIS) M 3 ( n ) = n ( n 3 + 1 ) 2 .