English   Japanese
Home   Site Map   Top   Prev.   Next   3-D ( 1   2   3   4   5 )   4-D ( 1   2   3   4   5   6 )

# Algorithm to make pantriagonal diagonal magic cubes

## 1. Algorithms for orders divisible by 4

A pantriagonal diagonal magic cube of even order can exist only if the order is higher than 7 and divisible by 4. If the order is divisible by 8, there exists a associated pantriagonal diagonal magic cube. See also algorithms to make Nasik magic cubes.

### 1.1 Non-associated pantriagonal diagonal magic cubes (m = 4x, m >= 12) (also complete)

A pantriagonal diagonal magic cube aijk of order m, where i,j,k = 0,...,m-1, is given by the following equation (aijk is also complete):
aijk = bijk m2 + bjki m + bkij + 1,

where
bijk = Tm(k) or m - 1 - Tm(k),
Tm(x) = x (where x < m/2), 3m/2-1-x (otherwise)    (identical to the definition of Tm(x) for pantriagonal magic cubes).

bijk = Tm(k) if i and j satisfy one of the following conditions:

• i mod (m/2) < m/4,   j mod (m/2) < m/4,   (i-j) mod (m/4) is not 1.
• i mod (m/2) < m/4,   j mod (m/2) >= m/4,   (i+j+1) mod (m/4) = 1.
• i mod (m/2) >= m/4,   j mod (m/2) < m/4,   (i+j+1) mod (m/4) = 0.
• i mod (m/2) >= m/4,   j mod (m/2) >= m/4,   (i-j) mod (m/4) is not 0.
bijk = m - 1 - Tm(k) if not, that is, i and j satisfy one of the following conditions:
• i mod (m/2) < m/4,   j mod (m/2) < m/4,   (i-j) mod (m/4) = 1.
• i mod (m/2) < m/4,   j mod (m/2) >= m/4,   (i+j+1) mod (m/4) is not 1.
• i mod (m/2) >= m/4,   j mod (m/2) < m/4,   (i+j+1) mod (m/4) is not 0.
• i mod (m/2) >= m/4,   j mod (m/2) >= m/4,   (i-j) mod (m/4) = 0.

For m = 12, bij0 (the plane of k = 0) is shown as follows:
 0 0 11 0 11 11 0 0 11 0 11 11 11 0 0 11 11 0 11 0 0 11 11 0 0 11 0 11 0 11 0 11 0 11 0 11 11 11 0 11 0 0 11 11 0 11 0 0 11 0 11 0 11 0 11 0 11 0 11 0 0 11 11 0 0 11 0 11 11 0 0 11 0 0 11 0 11 11 0 0 11 0 11 11 11 0 0 11 11 0 11 0 0 11 11 0 0 11 0 11 0 11 0 11 0 11 0 11 11 11 0 11 0 0 11 11 0 11 0 0 11 0 11 0 11 0 11 0 11 0 11 0 0 11 11 0 0 11 0 11 11 0 0 11

Note This algorithm also works for order 8, but it generates an order-8 Nasik magic cube. We can construct an order-8 pantriagonal diagonal magic cube which is not Nasik by another method. Here is an example of such an order-8 magic cube.

Back

### 1.2 Associated pantriagonal diagonal magic cubes (m = 8x, m >= 8) (also 3D-compact)

An associated pantriagonal diagonal magic cube aijk of order m, where i,j,k = 0,...,m-1, is given by the following equation (aijk is also 3D-compact):
aijk = 83(m/8)2 bijk + 83(m/8) cijk + 83 dijk + eijk + 1.

where
bijk = [i/8] (if {(i + 4j + 2k + 1) mod 8} < 4 ),
(m/8) - 1 - [i/8] (if {(i + 4j + 2k + 1) mod 8} >= 4 ),
cijk = [j/8] (if {(2i + j + 4k + 1) mod 8} < 4 ),
(m/8) - 1 - [j/8] (if {(2i + j + 4k + 1) mod 8} >= 4 ),
dijk = [k/8] (if {(4i + 2j + k + 1) mod 8} < 4 ),
(m/8) - 1 - [k/8] (if {(4i + 2j + k + 1) mod 8} >= 4 ),
eijk = 28 B[8]ijk + 27 B[7]ijk + 26 B[6]ijk + 25 B[5]ijk + 24 B[4]ijk + 23 B[3]ijk + 22 B[2]ijk + 2 B[1]ijk + B[0]ijk.

The binary magic cubes B[0]ijk to B[8]ijk is defined as follows:
B[8]ijk = (i2 + j1 + k0) mod 2,
B[7]ijk = (i2 + i1 + j1 + j0 + k0) mod 2,
B[6]ijk = (i2 + i0 + j1 + j0 + k0) mod 2,
B[5]ijk = (i0 + j2 + k1) mod 2,
B[4]ijk = (i0 + j2 + j1 + k1 + k0) mod 2,
B[3]ijk = (i0 + j2 + j0 + k1 + k0) mod 2,
B[2]ijk = (i1 + j0 + k2) mod 2,
B[1]ijk = (i1 + i0 + j0 + k2 + k1) mod 2,
B[0]ijk = {i0 + j2 + j1 + k2 + k1 + (j1+j0)(k1+k0)} mod 2.
where
i2 = [i/4] mod 2,   i1 = [i/2] mod 2,   i0 = i mod 2,
j2 = [j/4] mod 2,   j1 = [j/2] mod 2,   j0 = j mod 2,
k2 = [k/4] mod 2,   k1 = [k/2] mod 2,   k0 = k mod 2.

Back

Home   Site Map   Top   Prev.   Next   3-D ( 1   2   3   4   5 )   4-D ( 1   2   3   4   5   6 )

Mitsutoshi Nakamura (Feedback)    To send an email to me, please enable JavaScript on your browser.
[Legal indication] Prohibit the send of any spam or advertising.