x, y, z ∈ {0, 1, 2, 3}
u = x ⊕ (2·y) ⊕ (3·z)
v = x ⊕ (3·y) ⊕ (2·z)
G(x,y,z) = 4u + v
F(x,y,z) = 2G(x,y,z) + 1
The products 2·y and 3·y refer to multiplication in GF(4), not ordinary integer multiplication.
Why use odd numbers?
The seed G ranges from 0 to 15 and sums to 30 on each magic line. Choosing F = 2G + 1 transforms a line of four terms into 2 × 30 + 4 = 64. Each plane contains all 16 odd numbers, whose total is 256.
2 × 30 + 4 = 64
The constant 64 is chosen through an affine transformation. It is neither the only possible constant nor a value forced by GF(4) alone.
Algebraic proof: why the line sums are constant
1. The twelve planes. The map (x,y,z) → (u,v) is linear over GF(4). Fixing one coordinate leaves two independent columns in the matrix A: all three 2 × 2 determinants are 1 in GF(4). Thus each plane contains each of the sixteen (u,v) pairs exactly once, and hence all sixteen values of G.
A = [1 2 3]
[1 3 2]
det(Axy) = det(Axz) = det(Ayz) = 1 (GF(4))
2. The 72 lines. Along every axial line and each diagonal of a coordinate plane, u and v each run through 0, 1, 2 and 3 exactly once, and their ordinary integer sums are 6. Therefore sum G = 4 × 6 + 6 = 30 and sum F = 2 × 30 + 4 = 64. For reversed diagonals, 3 − t = t ⊕ 3 in this encoding.
3. Diagonal translation symmetry. Because 1 ⊕ 2 ⊕ 3 = 0 in GF(4), adding the same element t by XOR to all three coordinates leaves u and v unchanged. This explains the four ones along the main diagonal, the central symmetry and the eight outer/core corner correspondences. It is not an ordinary spatial translation.
F(x ⊕ t, y ⊕ t, z ⊕ t) = F(x,y,z)
for every t ∈ {0,1,2,3}
4. The eight octants. Within each 2 × 2 × 2 block, varying the three least significant bits causes both u and v to take each of the values 0–3 twice. Each sums to 12: sum G = 4 × 12 + 12 = 60, and sum F = 2 × 60 + 8 = 128.
8 octants × 128 = 1024 = total sum of F
5. Scope. This is not a normal order-4 magic cube, which would use the integers from 1 to 64 once each and have a magic constant of 130, nor is it a perfect magic cube: the four space diagonals do not sum to 64. The stella octangula is a classical geometric figure; its numerical relationship with F is what we study here.