Introduction
Hypercube equations
Statistical tables
Modular equations
Comparative rarity
Introduction
This page is a collection of
mathematical expressions and tables that are involved with magic squares and
cubes. Emphasis will be put on relationships between magic hypercubes of
different dimensions. The terms magic square, magic cube, magic tesseract, etc.
will be used for specific dimensions.
The term magic hypercube will be used to indicate a magic rectilinear object in
any dimension.
Much of this material is taken from John
R. Hendricks books which, unfortunately, are now out of print.
Some are available for free download at John
Hendricks memorial website.
A small interactive spreadsheet program that shows statistics based on 3 input
variables is available for download
here.
The Magic Square Lexicon is still available here.
Mitsutoshi Nakamura seems to be the only person doing extensive work with magic
tesseracts at this time. He contributed much of the information on tesseract
classes. His website is
here.
It is appropriate to mention here,
the different types of mathematics that may be involved in the
investigation of magic hypercubes.

·
Arithmetic

·
Algebra

·
Geometry (in regard to coordinates, used in modular
equations and paths).

·
Modular arithmetic, congruences

·
Different number systems (where radix = m)

·
Matrix arithmetic
Variables used on this page

m = order

n = dimension

r = represents all
agonals from 1agonal to nagonals. i.e all lines in the hypercube.

S = magic constant

Nasik will be used to
denote hypercubes where all lines through each cell sum correctly. This is an
unambiguous term that avoids the confusion between Hendricks perfect
and Boyer’s perfect. C. Planck set the precedent for this in his 1905
paper.
C. Planck,
The Theory of Path Nasiks, Printed for private
circulation by A. J. Lawrence, Printer, Rugby (England),1905
(Available from The University Library, Cambridge).See
a quotation here.
W. S. Andrews, Magic Squares and Cubes. Open Court Publ.,1917.
Pages 365,366, by Dr. C. Planck.
Republished by Dover Publ., 1960 (no ISBN); Dover Publ., 2000,
0486206580; Cosimo Classics, Inc., 2004, 1596050373

Magic constant or Sum of a hypercube
…. S =
{m(m^{n}
+ 1)} / 2

Minimum sums required to be Simple
magic ..... S_{s} = 2^{n}^{1}
+ nm^{n}^{1}

Minimum sums required to be Nasik
magic ....
S_{n}
= {(3^{n} –
1)m^{n}1} / 2

Smallest order for a
Nasik hypercube ....
2^{n} ....
2^{n} + 1 if
associated

Paths (lines) through any cell of a
hypercube ….
P
= (3^{n} – 1) / 2

Number of aspects (views) of a
hypercube …. A = 2^{n
}n!

1agonals (orthogonal lines, irows)
in a hypercube …. O = n(m^{n}^{1})

There are 2^{n} corners
and 2^{n1} nagonals in a magic hypercube

Squares in a ndimensional hypercube
of order m ….
N
= {n(n – 1) / 2} m^{n}^{2}
Of the above, …. n(n1)2^{n3} are
boundary squares.

Edges in a ndimensional magic
hypercube ….
E
= n(2^{n}^{1})
Hypercubes –Minimum number of
correct summations
This table provides the minimum
requirements for each category. Usually, there are some extra lines which may
sum the magic sum, but not a complete set so as to change the category.
In this table I have replaced the term perfect (Hendricks) with Nasik.
This table is taken from The
Magic Cube Lexicon, but edited with added tesseract material supplied by
Mitsutoshi Nakamura Sept. 20, 2007.
First person shown to construct
each minimum order cube and tesseract is to the best of my knowledge. If you
have different information, please let me know. Minimum order for some of the
tesseract classes shown has not yet been established. In that case I show the
first constructer for the class.
John Hendricks was the first to publish all 58 order3 magic tesseracts in
(Magic Square Course, 2nd edition, 1992).
NOTE: I cannot testify as to the
correctness of these tesseracts, as I have not had a chance to check out their
features.
H. D. Heinz & J.
R. Hendricks, Magic Square Lexicon: Illustrated, , HDH, 2000,
0968798500, page 165 (edited)
Mitsutoshi Nakamura’s tesseracts at
http://homepage2.nifty.com/googol/magcube/en/
Hypercubes –Minimum number of correct summations  based
on smallest order possible 
Magic
Hypercube 
Lowest
Order (m) 
ragonals 

Min. Sums 
This order
first Built by 
1 
2 
3 
4 
Total 
Square 








Simple 
3 
2m 
2 
 
 
2m + 2 
8 
? 
Nasik
(Pandiagonal and Perfect) 
4 
2m 
2m 
 
 
4m 
16 
? 
Cube 








Simple 
3 
3m^{2} 
 
4 
 
3m^{2}
+ 4 
31 
Hugel  1876 
Diagonal
(Boyer/Trump Perfect) 
5 
3m^{2} 
6m 
4 
 
3m^{2}+6m+4 
109 
Trump/Boyer 
2003 
Pantriagonal 
4 
3m^{2} 
 
4m^{2} 
 
7m^{2} 
112 
Frost  1878 
PantriagDiag 
8? 
3m^{2} 
6m 
4m^{2} 
 
7m^{2}+6m 
496 
Nakamura 
2005 
Pandiagonal 
7 
3m^{2} 
6m^{2} 
4 
 
9m^{2}
+ 4 
445 
Frost – 1866 
Nasik
(Hendricks Perfect) 
8 
3m^{2} 
6m^{2} 
4m^{2} 
 
13m^{2} 
832 
Barnard 1888 
Tesseract 








Simple 
3 
4m^{3} 
 
 
8 
4m^{3}
+ 8 
116 
Planck – 1905 
Triagonal 
4 
4m^{3} 
 
16m 
8 
4m^{3}
+ 16m + 8 
328 
Nakamura 
2007 
Diagonal 
4 
4m^{3} 
12m^{2} 
 
8 
4m^{3
}+ 12m^{2} + 8 
456 
Nakamura –
2007 
Diagonal +
Triagonal 
8? 
4m^{3} 
12m^{2} 
16m 
8 
4m^{3}
+ 12m^{2} + 16m + 8 
2,952 
Nakamura –
2007 
Panquadragonal 
4 
4m^{3} 
 
 
8m^{3} 
12m^{3} 
768 
Hendricks –
1968 
Triagonal +
Pan4 
4 
4m^{3} 
 
16m 
8m^{3} 
12m^{3}
+ 16m 
832 
Nakamura –
2007 
Diagonal +
Pan4 
8? 
4m^{3} 
12m^{2} 
 
8m^{3} 
12m^{3}
+ 12m^{2} 
6,912 
Nakamura –
2007 
Diagonal +
Triagonal+Pan4 
8? 
4m^{3} 
12m^{2} 
16m 
8m^{3} 
12m^{3}
+ 12m^{2} + 16m 
7,040 
Nakamura –
2007 
Pandiagonal 
9? 
4m^{3} 
12m^{3} 
 
8 
16m^{3}
+ 8 
11,672 
Nakamura –
2007 
Triagonal +
Pan2 
16? 
4m^{3} 
12m^{3} 
16m 
8 
16m^{3}
+ 16m + 8 
65792 
Nakamura –
2010 
Pantriagonal 
4 
4m^{3} 
 
16m^{3} 
8 
20m^{3}
+ 8 
1,288 
Nakamura –
2007 
Diagonal +
Pan3 
8? 
4m^{3} 
12m^{2} 
16m^{3} 
8 
20m^{3}
+ 12m^{2} + 8 
11016 
Nakamura –
2010 
Pan2 +Pan4 
13? 
4m^{3} 
12m^{3} 
 
8m^{3} 
24m^{3} 
52,728 
Nakamura –
2007 
Triagonal +
Pan2 + Pan4 
16? 
4m^{3} 
12m^{3} 
16m 
8m^{3} 
24m^{3}
+ 16m 
98,560 
Nakamura –
2007 
Pan3 + Pan4 
4 
4m^{3} 
 
16m^{3} 
8m^{3} 
28m^{3} 
1,792 
Nakamura –
2007 
Diagonal +
Pan3 + Pan4 
8 
4m^{3} 
12m^{2} 
16m^{3} 
8m^{3} 
28m^{3}
+ 12m^{2} 
15,104 
Nakamura –
2007 
Pan2 + Pan3 
15? 
4m^{3} 
12m^{3} 
16m^{3} 
8 
32m^{3}
+ 8 
108,008 
Nakamura –
2007 
Nasik
(Hendricks perfect) 
16 
4m^{3} 
12m^{3} 
16m^{3} 
8m^{3} 
40m^{3} 
163,840 
Hendricks 
1998 
Arnoux’s cube is the earliest normal perfect (nasik) magic
cube that I have been able to locate.
It preceded by one year the order 8 and two order 11 perfect cubes of
F.A.P.Barnard. A.H. Frost had published an order 9 perfect cube
(but with nonconsecutive numbers) in 1878. Of course, not the smallest
possible.
Gabriel Arnoux,
Cube Diabolique de DixSept, Académie des Sciences, Paris, France, April
17, 1887.
I show Hendricks as the first to publish a
perfect (nasik) magic tesseract. However, C. Planck showed 1 plane of a perfect order 16
octahedroid in his 1905 paper.
C. Planck, The Theory of Path
Nasiks, Printed for private circulation by A. J.
Lawrence, Printer, Rugby (England),1905 (Available from The University Library,
Cambridge).
Hypercubes  Correct Summations Required 
Magic Square
Simple 
Magic Cube
Simple 
Magic Tesseract
Simple 
m rows 
m^{2} rows 
m^{3} rows 
m columns 
m^{2} columns 
m^{3} columns 
2 diagonals 
m^{2 }pillars 
m^{3} pillars 

4 3agonals 
m^{3} files 


8 4agonals 
Total = 2m + 2 
Total = 3m^{2} + 4 
Total = 4m^{3} + 8 
Nasik perfect 
Nasik perfect 
Nasik perfect 
m rows 
m^{2} rows 
m^{3} rows 
m columns 
m^{2} columns 
m^{3} columns 
2m diagonals 
m^{2 }pillars 
m^{3} pillars 

4m^{2} 3agonals 
m^{3} files 

6m^{2} 2agonals 
8m^{3} 4agonals 


12m^{3}
3agonals 


16m^{3}
2agonals 
Total = 4m 
Total = 13m^{2} 
Total = 40m^{3} 

Comparing
Order3 Hypercube Dimension Facts 
Dimension 
Correct lines 
Number of Basic 
Aspects 
2 
8 
1 
8 
3 
31 
4 
48 
4 
116 
58 
384 
5 
421 
2992 
3840 
6 
1490 
543328 
46080 
Keh
Ying Lin, Cubes and Hypercubes of Order Three, Discrete
Mathematics, 58, 1986,
pp 159166
J. R. Hendricks, Magic Square Course, selfpublished 1991
J. R. Hendricks, All Third Order Magic Tesseracts,
selfpublished 1999, 0968470025
H. D. Heinz & J. R. Hendricks, Magic Square Lexicon: Illustrated,
, HDH, 2000, 0968798500, page 93
Notes for table on left:
J. R.
Hendricks, Perfect nDimensional Magic Hypercubes of Order 2^{n},
Selfpublished, 1999, 0968470041.
H. D. Heinz & J. R. Hendricks, Magic Square Lexicon: Illustrated,
, HDH, 2000, 0968798500, page 90 
An nagonal is a line
going from 1 corner, through the center to the opposite corner, of a magic
hypercube.
For each continuous nagonal,
there are a number of broken parallel lines, depending upon the order of the
hypercube. There are 2 continuous diagonals in a square, 4 continuous
triagonals in a cube, and 8 continuous quadragonals in a tesseract.

Number of broken nagonals for each continuous one 
Total pannagonals 
n 
2 segment 
3 segments 
4 segments 
Total 
1 segment 
Total 
2 
m–1 
0 
0 
m 
2 
2m 
3 
3(m1) 
(m1)(m2) 
0 
m^{2} 
4 
4m^{2} 
4 
2(5m8) 
2(2m^{2}7m+7) 
(m1)(m2)(m3) 
m^{3} 
8 
8m^{3} 
H. D. Heinz &
J. R. Hendricks, Magic Square Lexicon: Illustrated, , HDH, 2000,
0968798500, page 99 (edited)

Because there are
four triagonals in a magic cube, the above figures must be
multiplied by four to obtain the actual number of triagonals in the
cube.
H. D.
Heinz & J. R. Hendricks, Magic Square Lexicon: Illustrated, ,
HDH, 2000,
0968798500, page 170 (edited)

Triagonals in
one direction of a cube 
Order 
1 segments 
2 segments 
3 segments 
Total 
3 
1 
6 
2 
9 
4 
1 
9 
6 
16 
5 
1 
12 
12 
25 
6 
1 
15 
20 
36 
7 
1 
18 
30 
49 
8 
1 
21 
42 
64 
9 
1 
24 
56 
81 
10 
1 
27 
72 
100 

Number of Hyperplanes Within a Hypercube 
Magic Hypercube 
irows
(1agonals) 
Squares 
Cubes 
Tesseracts 
5D
Hypercubes 
Squares 
2m 
1 
0 
0 
0 
Cubes 
3m^{2} 
3m 
1 
0 
0 
Tesseracts 
4m^{3} 
6m^{2} 
4m 
1 
0 
5D Hypercubes 
5m^{4} 
10m^{3} 
10m^{2} 
5m 
1 
6D Hypercubes 
6m^{5} 
15m^{4} 
20m^{3} 
15m^{2} 
6m 
7D Hypercubes 
7m^{6} 
21m^{5} 
35m^{4} 
35m^{3} 
21m^{2} 
Not all of these hyperplanes are magic unless the Hypercube
is Nasik (Hendricks perfect).
J. R. Hendricks,
Perfect nDimensional Magic
Hypercubes of Order 2^{n}, Selfpublished, 1999, 0968470041 page
5.
nDimensional Magic
Hypercubes – Statistical Information 
Dim 
Hyper
cube 
#
of Corners 
#
of Edges 
Bounded by 
Magic Sum 
Paths through any cell 
Minimum Sums required for magic 
Minimum Sums required for Nasik Perfect 
#
of Viewing Aspects 
0 
Point 
1 
0 
0 
1 
0 
1 
0 
1 
1 
Line seg. 
2 
1 
2
points 
S =
{m + 1)} /
2 
0 
1 
1 
2 
2 
Square 
4 
4 
4
line segments 
S =
{m(m^{2}
+ 1)} / 2 
4 
2m
+ 2 
4m 
8 
3 
Cube 
8 
12 
6
squares 
S =
{m(m^{3}
+ 1)} / 2 
13 
3m^{2}
+ 4 
13m^{2} 
48 
4 
Tesseract 
16 
32 
8
cubes 
S =
{m(m^{4}
+ 1)} / 2 
40 
4m^{3}
+ 8 
40m^{3} 
384 
n 
Hypercube 
2^{n} 
n(2^{n}^{1}) 
2n
hypercubes
(of n1) 
S =
{m(m^{n}
+ 1)} / 2 
P
= (3^{n} – 1) / 2 
nm^{n}^{1} + 2^{n}^{1} 
S_{n}
=
{(3^{n} – 1)m^{n}1} / 2 
2^{n}n! 
J.
R. Hendricks, Magic Squares to Tesseract by Computer, Selfpublished,
1998, 0968470009 page 134 (edited)
This is one method of finding
solutions to magic hypercubes. This was a favored method of the late John R.
Hendricks.
If the digits of a number can be
expressed as a function of their coordinate location, then the equation(s)
describing the relationship can be called digital equations. They are sometimes
referred to as congruence equations or modular equations.
For example: To solve the order
3 magic square (the Luoshu).
If at coordinate location (1, 3) we wish to find the number and it is known
that:
D2 Ξ x + y (mod 3)
And D1 Ξ 2x + y + 1 (mod 3
then the two digits D2 and D1 can
be found.
D2 Ξ 1 + 3 Ξ 4 Ξ 1 (mod
3)
And D1 Ξ 2 + 3 + 1 Ξ 6 Ξ 0 (mod 3)
So the number 10 (mod 3) is
located at (1, 3).
To convert to a decimal number in the range of 1 to m; 3 * 1 + 0 + 1 = 4
J. R. Hendricks,
Magic Squares to Tesseract by Computer, Selfpublished, 1998, 0968470009
pp. 1013
H. D. Heinz & J. R. Hendricks, Magic Square Lexicon: Illustrated, , HDH,
2000, 0968798500, page 35
Comparative rarity
A quick study reveals the
futility of attempting to construct a magic hypercube by simply arranging the
numbers randomly. That is, without using mathematical methods.
To illustrate this point,
consider the easiest of all magic hypercubes to construct, the order 3 magic
square.
The array uses just nine integers, which can be arranged in 9 factorial ways. 9
factorial (written 9!) = 1x2x3x4x5x6x7x8x9 = 362,880. There is 1 basic order 3
magic square, but it may be shown in 8 aspects (due to rotations and /or
reflections). So the chance of stumbling on one of these 8 variations is 8/9! Or
1 chance in 45,360.
The next smallest hypercube is
the order 4 magic square. There are 880 basic squares of this order, times the 8
variations gives a total of 7040 squares. They use the integers from 1 to 16 so
the relative rarity is 7040/16!, or 1 chance in 2,971,987,200.
By the time we get to an order 8
magic square, we will find the number of possible combinations to try is 64
factorial. This is greater then the number of atoms in the universe!
Consider then, the rarity of an
order 3 tesseract, which uses the numbers from 1 to 81. Or an order 8 tesseract
where the number of possibilities is factorial 4096.
