Home Site Map Top Prev. Next 3-D ( 1 2 3

A pandiagonal magic cube of **even** order m can exist only if the order is divisible by 8, and an associated pandiagonal magic cube of **even** order can exist under the same condition. Also refer the page for Nasik magic cubes, which class is higher than pandiagonal.

A pandiagonal magic cube a_{ijk} of order m, where i,j,k = 0,...,m-1, is given by the following equation:

a_{ijk} = **T**_{m}(b_{ijk}) m^{2} + **T**_{m}(c_{ijk}) m + **T**_{m}(d_{ijk}) + 1,

where

**T**_{m}(x) = x (where x < m/2), 3m/2-1-x (otherwise) (identical to the definition of **T**_{m}(x) for pantriagonal magic cubes).

The definitions of b_{ijk}, c_{ijk}, and d_{ijk} are as follows:

**if i+j+k is even:**

b_{ijk} = i + (m/4)j - (m/4+s)k (mod. m), 0 <= b_{ijk} < m,

c_{ijk} = (m/4)i + j - (m/4+s)k (mod. m), 0 <= c_{ijk} < m,

d_{ijk} = (m/4)i + (m/2)j + k (mod. m), 0 <= d_{ijk} < m,

**if i+j+k is odd:**

b_{ijk} = -i - (m/4)j + (m/4+s)k + m/2 (mod. m), 0 <= b_{ijk} < m,

c_{ijk} = -(m/4)i - j + (m/4+s)k + m/2 (mod. m), 0 <= c_{ijk} < m,

d_{ijk} = (m/4)i + (m/2)j + k (mod. m), 0 <= d_{ijk} < m,

where

s = -1 (if m-24 is divisible by 32), 1 (otherwise).

An associated pandiagonal magic cube can be constructed by a similar way to the algorithm for pantriagonal diagonal magic cubes. The only difference is the definition of the binary cube B[0]_{ijk}:

B[0]_{ijk} = {i_{0} + j_{2} + j_{0} + k_{2} + k_{0} + (j_{1}+j_{0})(k_{1}+k_{0})} mod 2.

A magic cube constructed by this algorithm is also 3D-compact.

An associated pandiagonal magic cube a_{ijk} of order m, where i,j,k = 0,...,m-1, is given by the following equation:

a_{ijk} = **T**_{m}(b_{ijk}) m^{2} + **T**_{m}(c_{ijk}) m + **U**_{m}(d_{ijk}) + 1,

where

**T**_{m}(x) = x (where x < m/2), 3m/2-1-x (otherwise),

**U**_{m}(x) = x (if x < m/4 or x >= 3m/4), m-1-x (otherwise).

(identical to the definitions of **T**_{m}(x) and **U**_{m}(x) for pantriagonal magic cubes)

The definitions of b_{ijk}, c_{ijk}, and d_{ijk} are as follows:

**if i+j+k is even:**

b_{ijk} = i + (m/4)j - (m/4+s)k (mod. m), 0 <= b_{ijk} < m,

c_{ijk} = (m/4)i + j - (m/4+s)k (mod. m), 0 <= c_{ijk} < m,

d_{ijk} = (m/4)i + (m/8)j + k + 3m/16 (mod. m), 0 <= d_{ijk} < m,

**if i+j+k is odd:**

b_{ijk} = -i - (m/4)j + (m/4+s)k + m/2 (mod. m), 0 <= b_{ijk} < m,

c_{ijk} = -(m/4)i - j + (m/4+s)k + m/2 (mod. m), 0 <= c_{ijk} < m,

d_{ijk} = (m/4)i + (m/8)j + k + 3m/16 (mod. m), 0 <= d_{ijk} < m,

where

s = -1 (if m-24 is divisible by 32), 1 (otherwise).

An associated pandiagonal magic cube a_{ijk} of order m, where i,j,k = 0,...,m-1, is given by the following equation (a_{ijk} is also complete):

a_{ijk} = **T**_{m}(b_{ijk}) m^{2} + **T**_{m}(c_{ijk}) m + **U**_{m,4}(d_{ijk}) + 1.

**T**_{m}(x) is already defined in the case of m = 16x. **U**_{m,4}(x) is defined in the page for Nasik magic cubes.

The definitions of b_{ijk}, c_{ijk}, and d_{ijk} are as follows:

**if i+j+k is even:**

b_{ijk} = i + (m/4)j - (m/4+s)k (mod. m), 0 <= b_{ijk} < m,

c_{ijk} = (m/4)i + j - (m/4+s)k (mod. m), 0 <= c_{ijk} < m,

d_{ijk} = (m/4)i + (m/8)j + 4k + 3(m/8+1)/2 (mod. m), 0 <= d_{ijk} < m,

**if i+j+k is odd:**

b_{ijk} = -i - (m/4)j + (m/4+s)k + m/2 (mod. m), 0 <= b_{ijk} < m,

c_{ijk} = -(m/4)i - j + (m/4+s)k + m/2 (mod. m), 0 <= c_{ijk} < m,

d_{ijk} = (m/4)i + (m/8)j + 4k + 3(m/8+1)/2 (mod. m), 0 <= d_{ijk} < m,

where

s = -1 (if m-24 is divisible by 32), 1 (otherwise).

A pandiagonal magic cube of **odd** order m can exist only if the order is higher by 6, and an associated pandiagonal magic cube of **odd** order can exist under the same condition.

The function **gcd** means the greatest common divisor.

In this case, m is prime to both 3 and 5.

A pandiagonal magic cube a_{ijk} of order m, where i,j,k = 0,...,m-1, is given by the following equation:

a_{ijk} = b_{ijk} m^{2} + c_{ijk} m + d_{ijk} + 1,

where

b_{ijk} = i + 2j + 3k + {(m-1)/2+3} (mod. m), 0 <= b_{ijk} < m,

c_{ijk} = i + 3j + 2k + {(m-1)/2+3} (mod. m), 0 <= c_{ijk} < m,

d_{ijk} = 2i + 3j - k + {(m-1)/2+2} (mod. m), 0 <= d_{ijk} < m.

Let q be **gcd**(m, 3x5) and p be m/q. In this case, p > 1 and q > 1.

A pandiagonal magic cube a_{ijk} of order m, where i,j,k = 0,...,m-1, is given by the following equation:

a_{ijk} = **S**_{m,q}(b_{ijk}) m^{2} + **S**_{m,q}(c_{ijk}) m + **S**_{m,q}(d_{ijk}) + 1,

where

b_{ijk} = i + 2j + 3k + {(m-1)/2+3} (mod. m), 0 <= b_{ijk} < m,

c_{ijk} = i + 3j + 2k + {(m-1)/2+3} (mod. m), 0 <= c_{ijk} < m,

d_{ijk} = 2i + 3j - k + {(m-1)/2+2} (mod. m), 0 <= d_{ijk} < m,

**S**_{m,q}(x) = **Q**_{p,q}([x/q], x mod q),

where [x] means the integer part of x.

**Q**_{p,q}(x, y), where 0 <= x < p and 0 <= y < q, is given by the following equations (identical to **Q**_{p,q}(x, y) for Nasik magic cubes):

**Q**_{p,q}(x, y) =
qx + y
(if 0 < x < p-1 and x is even),

qx + (q-1-y)
(if 0 < x < p-1 and x is odd),

y/2 + (q-1)/2
(if x = 0 and y is even),

(y-1)/2
(if x = 0 and y is odd),

y/2 + (p-1)q
(if x = p-1 and y is even),

(y-1)/2 + pq - (q-1)/2
(if x = p-1 and y is odd).

See the page for Nasik magic cubes to see examples of **Q**_{p,q}(x, y) and **S**_{m,q}(x).

In this case, always m = 15.

A pandiagonal magic cube a_{ijk} of order m, where i,j,k = 0,...,m-1, is given by the following equation:

a_{ijk} = **S**^{*}(b_{ijk}) m^{2} + **S**^{*}_{m}(c_{ijk}) m + **S**^{*}_{m}(d_{ijk}) + 1,

where

b_{ijk} = i + 2j + 3k + {(m-1)/2+3} (mod. m), 0 <= b_{ijk} < m,

c_{ijk} = i + 3j + 2k + {(m-1)/2+3} (mod. m), 0 <= c_{ijk} < m,

d_{ijk} = 2i + 3j - k + {(m-1)/2+2} (mod. m), 0 <= d_{ijk} < m,

**S**^{*}_{15}(x) = **R**_{3,5}(x mod 3, x mod 5) - 1.

**R**_{3,5} is an order-(3,5) associated **magic rectangle**. For more information, see the page for Nasik magic cubes.

Home Site Map Top Prev. Next 3-D ( 1 2 3

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.

This page was last updated on August 8, 2016.

"Magic Cubes and Tesseracts" http://magcube.la.coocan.jp/magcube/en/

Copyright © 2004-2016, Mitsutoshi Nakamura. All rights reserved.