CH. VII] MAGIC SQUARES 153 



(u, v), where u=h — a and v = k — b. Hence, if these are to fit in 

 their places, we must also have u and v unequal, and u, v, u + v, 

 and u — v prime to n. Also a, b, u, and v cannot be zero. 

 Lastly the cross-steps (h, k) must be so chosen that in no case 

 shall a cross-step lead to a cell already occupied. This would 

 happen, and therefore the rule would fail, if p steps (a, b) from 

 any cell and q steps (u, v) from it, where p and q are each less 

 than n, should lead to the same cell. Thus, to the modulus 

 n, we cannot have pa = qu = q(h — a), and at the same time 

 pb=qv=q(k — b). 



It is impossible to satisfy these conditions if n is equal to 3 

 or to a multiple of 3. For a and b are to be unequal, not zero, 

 and less than n, and a + b is to be less than n and prime to n. 

 Thus we cannot construct a pandiagonal square of the third 

 order. 



Next I will show that, if n is not a multiple of 3, these 

 conditions are satisfied when a=l, 6 = 2, h = 0, k = — l, and 

 therefore that in this case these values provide a particular 

 solution of the general problem. It is at once obvious that in 

 this case a and b are unequal, not zero, and prime to n, that 

 b + a and b — a are prime to n, and that the corresponding 

 relations for u and v are true. The remaining condition for the 

 validity of a rule based on these particular steps is that it shall 

 be impossible to find integral values of p and q each less than 

 n, which will simultaneously make p = —q, and 2p = — 3q. This 

 condition is satisfied. Hence, any odd pandiagonal square of 

 an order which is not a multiple of 3 can be constructed by 

 this rule. Thus, to form a pandiagonal square of the fifth order 

 we may put 1 in any cell; proceed by four successive steps, 

 like a knight's move, of one cell to the right and two cells up, 

 writing consecutively numbers 2, 3, 4, 5 in each cell, until we 

 come to a cell already occupied; then take one step, like a rook's 

 move, one cell down, and so on until the square is filled. This 

 is illustrated by the square delineated in figure xvi. 



Further discussion of the general case depends on whether 

 or not n is prime; here I will confine myself to the simpler 

 alternative, and assume that n is prime : this will sufficiently 



