OFFSET
1,1
COMMENTS
A magic cube is the 3-dimensional equivalent of a magic square, that is, n^3 distinct integers arranged in an n X n X n grid such that the sum of the integers in each row, each column, each pillar, and the four main space diagonals is equal to the same number, called magic constant of the cube.
The magic cube is associative if the sum of any 2 numbers, symmetrically located relative to the center of the cube, is equal to the same number, called constant of associativity of the cube.
Magic cubes of order 3 are simple magic cubes.
All magic cubes of order 3 are associative.
The first two prime magic cubes of order 3 were found by Akio Suzuki in 1977 (see Prime Number Magic Cubes link).
The general formula of the magic cube of order 3:
......................................................
. x1, x2, 3k/2-x1-x2,
. x3, x4, 3k/2-x3-x4,
. 3k/2-x1-x3, 3k/2-x2-x4, -3k/2+x1+x2+x3+x4,
.......................................................
. -k+x2+x3+x4, 2k-2*x2-x4, k/2+x2-x3,
. 2k-2*x3-x4, k/2, -k+2*x3+x4,
. k/2-x2+x3, -k+2*x2+x4, 2k-x2-x3-x4,
.......................................................
. 5k/2-x1-x2-x3-x4, -k/2+x2+x4, -k/2+x1+x3,
. -k/2+x3+x4, k-x4, k-x3,
. -k/2+x1+x2, k-x2, k-x1
........................................................
Here k is the constant of associativity (any even number), x1, x2, x3, x4 are any integers.
LINKS
Harvey Heinz, Prime Number Magic Cubes
Natalia Makarova, Discussion on scientific forum (in Russian)
Wikipedia, Magic cube
EXAMPLE
For n = 3, a(3) = 5091.
......................
. 1061 3167 863
. 2243 431 2417
. 1787 1493 1811
......................
. 2447 23 2621
. 1871 1697 1523
. 773 3371 947
......................
. 1583 1901 1607
. 977 2963 1151
. 2531 227 2333
......................
CROSSREFS
KEYWORD
nonn
AUTHOR
Natalia Makarova, Mar 23 2014
STATUS
approved