Basic equations for odd order ultramagic squares  

The below stated formulae k ranges from 0 to (m  3) / 2; i from 0 to m  1 (column) and j from 0 to (m  1) / 2 if i < (m  1)/ 2 and (m  3) / 2 if (i >= (m  1) / 2 for equality the notation '==' is used to distinguish form assignment '=' as is usual in the C programming language For the doubly even orders k ranges from 0 to (m  2) / 2 

Row equations R^{k}_{i,j} 
R^{k}_{i,j} = [ (j == k) ]  
Every row sums to 0  
Column equations C^{k}_{i,j} 
C^{k}_{i,j} = [ (i == k)  (i == m  1 k) ]  
Every column sums to 0  
Diagonal equations D^{k}_{i,j} 
D^{k}_{i,j} = [ (i  j == k + 1)  (j  i == k + 1)  (i  j == m  1  k) ]  
Every diagonal sums to 0  
SubDiagonal equations S^{k}_{i,j} 
S^{k}_{i,j} = [ (i + j == k)  (i + j == m  2  k) + (i + j == m  k) ]  
Every subdiagonal sums to 0  
derivable equations for odd order ultramagic squares  
Any combination of the above 4 (m  1) / 2 equations naturally also sum 0 Below are some remarkable patterns stated we came across restated in the above formulated basic set of equations. the given expressions need some verification but are currently based on orders 5 7 and 9. The actual equations all read E = 0. 

Top left corner equation 
E_{i,j} = _{k=0}∑^{(m3)/2} [ R^{k}_{i,j} + C^{k}_{i,j} ]  
this top left corner consist of (m  1)^{2} / 4 numbers counted twice the top halve central column and left halve central row of (m  1) / 2 numbers each 

E_{i,j} = { _{k=0}∑^{(m2)/2} [ R^{k}_{i,j} + C^{k}_{i,j} ] } / 2  
(equation for doubly even order) this top left corner consist of m^{2} / 4 numbers 

Top left triangle equation 
E_{i,j} = { _{k=0}∑^{(m3)/2} ((m  1) / 2  k) [ R^{k}_{i,j} + C^{k}_{i,j} + S^{(m3)/2k}_{i,j} ] } / m  
this top left triangle consist of (m^{2}  1) / 8 numbers  
E_{i,j} =
{ _{k=0}∑^{(m2)/2} (m / 2  k) [ R^{k}_{i,j} +
C^{k}_{i,j} + S^{(m2)/2k}_{i,j} ] } subtract the corner equation and devide by m / 2 

(equation for doubly even order; note: S^{(m2)/2} == 0) this top left triangle consist of m (m + 2) / 8 numbers m (m  2) / 8 numbers counted twice 

Top right triangle equation 
E_{i,j} = { _{k=0}∑^{(m3)/2} ((m  1) / 2  k) [ R^{k}_{i,j}  C^{k}_{i,j}  D^{(m3)/2k}_{i,j} ] } / m  
this top right triangle consist of (m^{2}  1) / 8 numbers  
E_{i,j} =
{ _{k=0}∑^{(m2)/2} (m / 2  k) [ R^{k}_{i,j} 
C^{k}_{i,j}  D^{(m2)/2k}_{i,j} ] } subtract the corner equation and devide by m / 2 

(equation for doubly even order; note: D^{(m2)/2} == 0) this top right triangle consist of m (m + 2) / 8 numbers m (m  2) / 8 numbers counted twice 

Top down triangle equation 
E_{i,j} =
{ _{k=0}∑^{(m3)/2} ((m  1) / 2  k) [ R^{k}_{i,j} + (2k <= (m3)/2) ( D^{2k}_{i,j}  S^{2k}_{i,j} )  (2k > (m3)/2) ( D^{m22k}_{i,j}  S^{m22k}_{i,j} ) ] } / m 

this top down triangle consist of (m^{2}  1) / 8 numbers 
General relations on basic equations for ultramagic squares  

Studying the basice equations a few general relations are noticable Note that with the odd order equations one might need to remirror the equations half central row back onto its place (might need to negate the element) 

Horizontal relations (all orders) 
Vertical relations (even orders) 
R^{k}_{i,j} = R^{k}_{m1i,j} C^{k}_{i,j} = C^{k}_{m1i,j} D^{k}_{i,j} = S^{k}_{m1i,j} 
R^{k}_{i,j} = R^{(m2)/2k}_{i,(m2)/2j} C^{k}_{i,j} = C^{k}_{i,(m2)/2j} D^{k}_{i,j} = S^{(m4)/2k}_{i,(m2)/2j} 