The Magic Encyclopedia ™

Pandiagonal Stacking
{note: investigative article}
(by Aale de Winkel)

<George Chen> sent me an order 12 and an order 15 panmagic square, which appeared to be 3 by 3 stacking together of order 4 resp order 5 panmagic square. Below my analysis of this stacking is generalized to all compound orders m = p * q, and notes are presented for the hypercube version (which I hold valid, untill shown otherwise)
currently, due to the novelity of this theory the various factors are not yet determined or preliminairy at best. A future upload might provide better estimate of factors.
Also it is noted that the order 15 George sent show that it is possible to have different pandiagolisers and regulators in each stackers position, this currently looks to me like a variation on the below outlined scheme which generalises into entire vectors of these pandiagolisers and regulators in stead the single ones used in the description below.
note also that the mentioned explicite regulator values are the current working values and might be in need of some adjustment upon future investigation
The notation "if (condition ; value condition true ; value condition false)" should be familiar to Excell users, others might conclude its meaning from the forementioned.
As evidence of the method described below this excell order 12 stacking spreadsheet is provided showing a regular order 12 panmagic square. The excell order 15 stacking spreadsheet is provided to show that the below defined compensator gives indeed the regular number range however spoils 4 sets of 1-agonal sums to show a "blockwise skew magic" square, simular to the order 3 stacker. Currently I conclude therefore that the described stacking method works for even ordered stackeys. Of course when also the stacker is a pandiagonal square the picture changes, since the stacker has no off-sums (this is left for future investigation)
NOTE: the order 2 natural square is also a skew magic square (just like the order 3 is) so the described method should also give regular order doubly even (>= 8) panmagic squares, but no doubly odd order squares (see the non-existence theorem of pandiagonal squares of doubly odd order)
(NOTE: the formulae might be slightly off, see the spreadsheet for the intended. This note gets dropped after correction (just need carefull checking))

Pandiagonal Stacking Sm = Stack(Sp,Sq,R,P,C)
construction method for compound order panmagic squares (orders: m = p * q)
Sm,k,l = q * {Sp,k/q,l/q Pi + Ri + Ci(?) + i(hc)} =[perm(q)] + i(lc)=[perm(q)]
Sq,k%q,l%q = i(hc)=[perm(q)] + i(lc)=[perm(q)]
the above formula seems to depict the entire stacking process, seen the various factors seem to
depend on the stacked squares high component latin square forced me to split up this stackey into
it's components, qualitatively lined up by the components digits changing permutation
The role of the compensator is yet to be determined.
(currently I haven't found an order 15 square yet with the regular number range)
Stacker Sp
factor: (p!)2
(preliminairy)
The order p square which stacks the order q square
The order p square which is needed to stack panmagic square to create panmagic square needs
to be of "skew magic" quality (ie: every (broken) 2-agonal sums to the same sum)
curently I hold these as row/column permutations of the "natural squares"
(Ni,j = i * p + j ; i,j = 0 .. p-1
suggesting the factor of (p!)2
Stackey Sq
factor: (see order q)
The order q square which stacked by the order p square
The panmagic square to be stacked adheres of course to the order q theory, currently there
is only a definite number for prime orders q as well as for some low non-prime orders
The Stacking method seems to rely heavely on the highest latin component square of the
Stackey, as it distributes the numbers of the "pandiagoliser" and the "regulator"
Pandiagoliser P
factor: (undetermined)
A panmagic square summing 0
The crux of the stacking process is the pandiagoliser, the pandiagolising square is placed
on the stackers celpositions and multiplied by the stackers number.
The pandiagolising square can be seen as a digit changing permutation changing permutation
of the stackey's highest component latin square, for even orders q the pandiagoliser can
consist of mere +/-1 with a total sum of 0 (easiest to stack). For odd order q mere +/-1
won't do, the other values can be compensated for quite easily by the compensator
(NOTE: presently this is an assumption due to the absence of a regular order 15 sample)
Regulator R
factor: 1
(preliminairy)
A panmagic square lining up the order q squares to the range of the order m square
currently I hold Ri = (p - 1) * i + if (Pi < 0 ; p ; 0) i = 0 .. p-1
The Regulator lines up the numbers thus to avoid doubly appearing numbers, trick is also
to have them exactly line up, in order to obtain a regular panmagic square of order m
The Regulator can be seen as a digit changing permutation to be applied to the Stackeys
high LS, values seem to depend on the used pandiagolisor so currently I hold the factor as 1.
Compensator C
factor: 1
(preliminairy)
A function compensating pandiagoliser steps
Ci = Sp,k,l * if (Pi < 0 ; 1 ; -1)
k,l = 0 .. p-1; i = 0 .. p - 1
This function merely reduces the steps taken by the pandiagoliser back to the steps of
the lowest value. (The above reduces steps to 1, it might well be possible to take bigger
steps. The main concern is to avoid double numbers in the determinator)
(NOTE: currently this is under scruteny since I havn't found an actual order 15 square yet)
Determinator Expression to determine whether the values gives order m square in the regular range
Di = Sp,k,l * (Pi + Ri + Ci(?)) + i
k,l = 0 .. p-1; i = 0 .. p - 1
in order for the order m square to have the full number range the above expression must
yield the full range of numbers 0 .. p m - 1

Currently I hold it that the above outlined principles hold equally well for hypercubes of any dimension pandiagolisers and regulators depending on the stackeys highest component latin hypercube, the regulator just needing bigger numbers to lineup the numberrange
currently I hold Ri = (p - 1)n-1 * i + if (Pi < 0 ; pn-1 ; 0)
as a regulator in this general hypercube case, the determinator needing to yield all numbers 0 .. p mn-1 (?)