The Magic Encyclopedia ™

Generating Squares
(by Aale de Winkel)

recent discussion with <Gil Lamb> took me to investigate what Gil called Generating Squares, later Gil changed the definition to some subset. <George Chen> reckognized these squares as Candy's "Auxiliary Squares" and provided a recursive counting argument. squares that share with the "Normal order m square" Nm[x,y] = x + my the property that all (broken) diagonals sum up to the magic sum Sm = m(m2-1)/2 (note I use the analitic numberrange in this article). The monagonals can sum up to any number (but in incremental order) as they do in Nm.
Currently I believe that all "Generating Sqares" can be obtained as multiplication of "Normal Rectangles"
pNq[x,y] = x + py ; x = 0..p-1, y = 0..q-1
A product which can be put into one formula. The listing below gives Generating Squares in normalized position.
This gives a definite amount of Generating Squares based on the type of the order m.

Auxiliary Rectangles / Normal Rectangles
<George Chen> Number of Auxiliary rectangles:
#(1Np) = 1; #(pN1) = 1 (? 0 ?) ; #(pNq ; q prime) = 1;
#(pNq) = #(1Nq + r|p,r>1∑ [ s prime,s<q,q|n ∑ #(rNq/s) - t ∑ #(rNt) ]
with t = GCD(q/q1,q/q2}, q1 , q2 two distinct prime factors of q.
Special cases #(p2Np2) = 3;
#(pnNpn) = (2n-1)!/[n!(n-1)!];
#(pN(tuqv)) = (u+1)(v+1)-1;
#(pNq2) = #(prime factors of p);
#(pqNrs) = 7;
Generating Squares
The following lists of Generating Squares generates them as products of "Normal Rectangles".
These products can be stated in one general formula.
(i=0n piNqi)[x,y] = i=0n k=0i pkqk { ([x % k=0i pk] \ k=0i-1 pk) + pn ([y % k=0i qk] \ k=0i-1 qk) };
i=0n pi = i=0n qi = m; x,y = 0..m-1
Examples up till 4 rectangles:
(pNq * rNs)[x,y] = (x%r) + r (y%s) + rs [(x\r) + p (y\s)]
(tNu * pNq * rNs)[x,y] = (x%r) + r (y%s) + rs [((x%pr)\r) + p ((y%qs)\s)] +
pqrs [(x\pr) + t (y\qs)]
(vNw * tNu * pNq * rNs)[x,y] = (x%r) + r (y%s) + rs [((x%pr)\r) + p ((y%qs)\s)] +
pqrs [((x%prt)\pr) + t ((y%qsu)\qs)] + pqrstu [(x\prt + v (y\qsu)]
prime order Nm
orders m = pq
p,q prime
p,q r = p
Npq Npq
qN1 pNpq
pN1 qNpq
pN1 pNpp
pNp qNq
qNq pNp
qNp pNq
pNq qNp
pNp pNp
orders m = pqr
p,q,r prime

note: '...'
deactivated from display
p,q,r r = p <> q p = q = r
Npqr Nppq Nppp
pN1 qrNpqr
qN1 prNpqr
rN1 qrNpqr
pN1 pqNppq
qN1 ppNppq
pN1 ppNppp
pqN1 rNpqr
qrN1 pNpqr
prN1 qNpqr
ppN1 qNppq
pqN1 pNppq
ppN1 pNppp
... pNq pqNpp
qNq ppNpp
pNp pqNpq
qNp ppNpq
pNp ppNpp
... ppNq qNpp
pqNq pNpp
ppNp qNpq
pqNp pNpq
ppNp pNpp
... pN1 pNq qNpp
pN1 qNq pNpp
qN1 pNq pNpp
pN1 qNp qNpq
qN1 pNp pNpq
pN1 pNp pNpq
pN1 pNp pNpp
... pNpq pqNp
qNpq ppNp
pNpp pqNq
qNpp ppNq
pNpp ppNp
... ppNpq qNp
pqNpq pNp
ppNpp qNq
pqNpp pNq
ppNpp pNp
... pN1 pNpq qNp
pN1 qNpq pNp
qN1 pNpq pNp
pN1 pNpp qNq
pN1 qNpp pNq
qN1 pNpp pNq
pN1 pNpp pNp
... pNq pNp qNp
pNq qNp pNp
qNq pNp pNp
pNp pNq qNp
pNp qNq pNp
qNp pNq pNp
pNp pNp qNq
pNp qNp pNq
qNp pNp pNq
pNp pNp pNp
orders m = pqrs
p,q,r prime

note: '...'
not yet estimated
p,q,r,s .... p = q = r = s
Npqrs .... Npppp
..... .... pN1 pppNpppp
ppN1 ppNpppp
pppN1 pNpppp
..... .... pNp pppNppp
ppNp ppNppp
pN1 pNp ppNppp
pppNp pNppp
pN1 ppNp pNppp
ppN1 pNp pNppp
..... .... pNpp pppNpp
ppNpp ppNpp
pN1 pNpp ppNpp
pNp pNp ppNpp
pppNpp pNpp
pN1 ppNpp pNpp
ppN1 pNpp pNpp
pNp ppNp pNpp
ppNp pNp pNpp
pN1 pNp pNp pNpp
..... .... pNppp pppNp
ppNppp ppNp
pN1 pNppp ppNp
pNp pNpp ppNp
pNpp pNp pNp
pppNppp pNp
pN1 ppNppp pNp
ppN1 pNppp pNp
pNp ppNpp pNp
ppNp pNpp pNp
pN1 pNp pNpp pNp
pNpp ppNp pNp
ppNpp pNp pNp
pN1 pNpp pNp pNp
pNp pNp pNp pNp

Note The above lists definite Generating Squares (GS) based on the type of the order, these kind of squares are rapidly available by multiplication of "Normal Rectangles" as above listed. This means that only Nm is reckognized as a "Auxiliary Square" when m is a prime order. For orders like 4, 9, and 25 only three GS's are obtained, expanding naturally to 7 GS's for other double prime orders (like 6,10 and 14), three primes enter with order 8 which has 10 GS's which corrrespond with 42 GS's for orders like 12, 18 and 20. The above systematic approach for four equal primes gives us 35 GS's for orders like 16 (This I haven't (yet?) estimated for the other quadruple prime orders)