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

# Algorithms to make pantriagonal magic tesseracts

[Order 4x] [Order 2x+1] [Order 4x+2]

## 1. Algorithms for orders divisible by 4

A pantriagonal magic tesseract exists for any order divisible by 4. In this case, a pan-3,4-agonal magic tesseract exists, which satisfies a stronger condition than pantriagonal. See algorithms to make pan-3,4-agonal magic tesseracts.

Note
An order-4 associated pantriagonal magic tesseract exists though an order-4 associated pan-3,4-agonal magic tesseract cannot exist. Here is an example of such a pantriagonal magic tesseract.

## 2. Algorithms for odd orders

A pantriagonal magic tesseract of odd order m can exist only if the order is higher than 4, and an associated pantriagonal magic tesseract of odd order can exist under the same condition.

### 2.1 Case m = 2x+1, m >= 5, and m is NOT divisible by 3 (associated)

A pantriagonal magic tesseract aijkh of order m, where i,j,k,h = 0,...,m-1, is given by the following equation:
aijkh = bijkh m3 + cijkh m2 + dijkh m + eijkh + 1,

where
bijkh = i + j + k + h + (m+3)/2   (mod. m),   0 <= bijkh < m,
cijkh = i - j + k + h + (m+1)/2   (mod. m),   0 <= cijkh < m,
dijkh = i + j - k + h + (m+1)/2   (mod. m),   0 <= dijkh < m,
eijkh = i + j + k - h + (m+1)/2   (mod. m),   0 <= eijkh < m.

This tesseract is expressed as follows by the XmlHypercube format by Aale de Winkel:
LP({1,1,1,1}+(m+3)/2,{1,-1,1,1}+(m+1)/2,{1,1,-1,1}+(m+1)/2,{1,1,1,-1}+(m+1)/2)

### 2.2 Case m = 2x+1, m >= 5, and m is divisible by 3 (associated)

A pantriagonal magic tesseract aijkh of order m, where i,j,k,h = 0,...,m-1, is given by the following equation:
aijkh = Sm,3(bijkh) m3 + Sm,3(cijkh) m2 + Sm,3(dijkh) m + Sm,3(eijkh) + 1,

where
bijkh = i + j + k + h + (m+3)/2   (mod. m),   0 <= bijkh < m,
cijkh = i - j + k + h + (m+1)/2   (mod. m),   0 <= cijkh < m,
dijkh = i + j - k + h + (m+1)/2   (mod. m),   0 <= dijkh < m,
eijkh = i + j + k - h + (m+1)/2   (mod. m),   0 <= eijkh < m,
Sm,3(x) = Qm/3,3([x/3], x mod 3),

where [x] means the integer part of x.

Qp,q(x, y), where 0 <= x < p and 0 <= y < q, is given by the following equations (identical to Qp,q(x, y) for Nasik magic cubes):
Qp,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 Qp,q(x, y) and Sm,q(x).

Back

## 3. Algorithms for singly even orders

A pantriagonal magic tesseract of singly-even order can exist if the order is higher than 9. An associated magic tesseract cannot exist.

Note It is unknown wheter an order-6 pantriagonal magic tesseract can exist or not.

### 3.1 Case m = 4x+2 and m >= 10 (non-associated)

A pantriagonal magic tesseract aijkh of order m, where i,j,k,h = 0,...,m-1, is given by the following equation:
When m is not divisible by 3:
aijkh = bijkh (m/2)4 + cijkh (m/2)3 + dijkh (m/2)2 + eijkh (m/2) + fijkh + 1,

When m is divisible by 3:
aijkh = bijkh (m/2)4 + Sm/2,3(cijkh) (m/2)3 + Sm/2,3(dijkh) (m/2)2 + Sm/2,3(eijkh) (m/2) + Sm/2,3(fijkh) + 1,

where
Sm/2,3(x) = Qm/6,3([x/3], x mod 3).

Qp,q(x, y), where 0 <= x < p and 0 <= y < q, is given by the following equations (identical to Qp,q(x, y) for Nasik magic cubes):
Qp,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 Qp,q(x, y) and Sm,q(x).

The tesseracts bijkh, cijkh, dijkh, eijkh, and fijkh are defined as follows:
bijkh = G16(v, z),
cijkh = J(i) + J(j) + J(k) + J(h)   (mod. m/2),   0 <= cijk < m/2,
dijkh = J(i) - J(j) + J(k) + J(h)   (mod. m/2),   0 <= dijk < m/2,
eijkh = J(i) + J(j) - J(k) + J(h)   (mod. m/2),   0 <= eijk < m/2,
fijkh = J(i) + J(j) + J(k) - J(h)   (mod. m/2),   0 <= fijk < m/2,

where
J(x) = x/2   (if x is even),    (m-1-x)/2   (if x is odd),
v = 8(i mod 2) + 4(j mod 2) + 2(k mod 2) + (h mod 2),   (0 <= v < 16),
z = J(i) + J(j) - J(k) - J(h)   (mod. m/2),   0 <= z < m/2.

The function GN(v, z) (where N is a power of 2, 0 <= v < N, and z >= 0) is defined as follows (this definition is identical to that for diagonal magic cubes):
when v is even:
GN(v, 0) = v,
GN(v, 1) = v + 1,
GN(v, 2) = N/2 - 1 - v/2,
GN(v, 3) = N - 1 - v/2,
GN(v, 2x+4) = N - 1 - v   for x >= 0,
GN(v, 2x+5) = v   for x >= 0,

when v is odd:
GN(v, 0) = v,
GN(v, 1) = v - 1,
GN(v, 2) = N/2 - 1 - (v-1)/2,
GN(v, 3) = N - 1 - (v-1)/2,
GN(v, 2x+4) = N - 1 - v   for x >= 0,
GN(v, 2x+5) = v   for x >= 0.

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.

This page was last updated on August 8, 2016.
"Magic Cubes and Tesseracts"   http://magcube.la.coocan.jp/magcube/en/