The Magic Encyclopedia ™

Perfect hypercubes of prime composite order
{note: investigative article}
(by Aale de Winkel)

Recently I discovered conditions on the digit changing permutation of a digit equation for hypercubes of prime composite order ie order m = p * q where p and q are both prime, the method also works when p = q so also square orders are accounted for.

prime composite order perfect hypercubes
Magic rectangle
Rp,q
a p by q rectangle with number 0 .. pq-1 with horizontal and vertical sums
S = j=0pq i = m (m - 1) / 2
Sq = S / p = q (pq - 1) / 2
Sp = S / q = p (pq - 1) / 2
Note when p an q are relatively prime the diagonal form a single line
holding all the numbers, this forms the permutation we need
In case p = q we need only "rectangles" summing in one direction
these "row-magic" squares is quite a novelty, to find a permutaton
just restart in the starting row.
double condition permutation
Pp,q
a permutation satisfying two simultaneous conditions
k=0p-1 Pp,q[kq + j] = Sq ; j = 0 .. q-1
k=0q-1 Pp,q[kp + j] = Sp ; j = 0 .. p-1
The diagonals of a magic rectangle satisfy this
perfect hypercubes (experimental fact)
LP({((r+l==n) ? m-2r : 2r) ; r,l = 0..n-1 ; m-2r > 2r}=Pp,q)
(same but 2n-1 replaced by (m-1)/2)
note the formula expands to
LP({1,2},{1,m-2})
LP({1,2,4},{1,2,m-4},{1,m-2,4})
LP({1,2,4,8},{1,2,4,m-8},{1,2,m-4,8},{1,m-2,4,8})
not the only possibility but the sequence I checked, I also checked the (m-1)/2 series
Counting arguments
(preliminairy notes)
preliminairy notes on counting arguments
ROW-MAGIC SQUARES:
in a {row-magic} square each row number can be freely positioned so p!p versions
also the rows can freely be permuted this gives p!p+1 variations given a
permutation for the squared order hypercubes. (p=3 -> 1296 = 2592/2)
NOTE a full iteration I found 2592 permutations, so there might be only 2 {row-magic}
order 3 squaress given this degrees of freedom (need to verify)
N = Np,p p!p+1
RECTANGLES:
A (semi-) magic rectangle can freely permute it rows and columns so every permutation
represents p! * q! variations.
N = Np,q p! q!
PARAMETERS:
Curently I'm without a theory to which or why parameters work with these digit changing
permutation, they change the "r-agonal offending" parameters into summing lines in the
r agonal directions in some manner which currently isn't quite clear. Currently I haven't
seen a non-perfect hypercube given the above mentioned parameter sequences
FURTHER FACTORS:
The various components can freely permute its role giving a factor of n!
each components can independently be digit changed: factor (Nn)

Notice these preliminairy factors multiply in a lot of {perfect} hypercubes, a lot needs
to be verified to avoid double counting, a "parameter theory" is yet to be found
IMPLICATION:
The layers of an order p hypercube can be juxtaposed into a p by pn-1 rectangle
the diagonal of which can be used to form a {perfect} order pn hypercube of
dimension N (provided pn > 2N)
Notice that each square can be positioned in every 8 aspectial variants so there are quite
a large number of permutations obtainable give an order p hypercube, also unclear yet whether
different hypercubes can generate the same set of permutation (this is probably the case, so
it'll be hard to obtain exact counting arguments). And of course the order p hypercube can be
placed in any aspectial variant, things need however to be verified against the above noticed
degrees of freedom.
INVESTIGATION:
A quick peak at various parameters suggest that the series
LP({1,a},{1,b})=[perm]
generate ok numberranges when the difference a-b is no multiple of either p nor q
NOTE suggested by squares of orders 9, 15 and 25, and need further investigation.


note: this is a novel "theory" on the digit changing permutations of these order, for order 9 I know that the permutations makes the "offending r-agonals" sum correctly. Currently not clear why the permutation work for all n-dimensional hypercubes (provided m > 2n of course)
note also:currently this is checked on orders < 40 on the LP parameter sequence above mentioned and certain variations. Probably the triagonal of a 3 by 5 by 7 magic beam give {perfect} order 105 (= 3*5*7) hypercubes, but I leave these monstrousities for future investigation.

example
order 3 square
1 6 5
8 4 0
3 2 7
aligned
0 4 8
6 1 5
3 7 2
aligned
0 5 7
8 1 3
4 6 2
0 1 2 4 5 3 8 6 7 0 1 2 5 3 4 7 8 6
LP({1,2},{1,7})=[0,1,2,4,5,3,8,6,7]

00 10 20 40 50 30 80 60 70
24 43 45 28 74 58 68 03 17
48 35 78 61 63 01 11 22 41
76 59 66 08 15 25 36 46 29
64 02 13 23 39 53 33 79 54
16 18 37 47 31 77 57 71 06
44 51 34 72 55 65 04 14 21
32 75 62 69 07 09 19 38 49
56 67 05 12 26 42 52 27 73
LP({1,2},{1,7})=[0,1,2,5,3,4,7,8,6]

00 10 20 50 30 40 70 80 60
26 51 27 37 65 77 57 04 16
31 43 71 78 54 01 11 23 48
68 75 58 07 17 24 45 28 38
55 02 14 21 49 34 44 69 72
15 18 46 29 41 66 76 61 08
52 35 42 63 73 56 05 12 22
39 67 79 62 06 09 19 47 32
74 59 03 13 25 53 33 36 64