152 MAGIC SQUARES [CH. VII 



bth upper line is outside the square we take it as equivalent to 

 the (n — 6)th lower line. 



It is clear that a and b cannot be zero, and that if a and b 

 are prime to n we can make n — 1 steps from any cell from 

 which we start, before we come to a cell already occupied. 

 Thus the first n numbers form a path which will give a different 

 unit-digit in every row, column, and in one set of n diagonals; 

 of the other diagonals, n — 1 are empty, and one contains every 

 unit-digit — thus they are constructed on magical lines. We 

 must take some other step (h, k) from the cell n to get to an 

 unoccupied cell in which we place the number n + 1. Con- 

 tinuing the process with n — 1 more steps (a, b) we get another 

 series of n numbers in various cells. If h and k are properly 

 selected this second series will not interfere with the first series, 

 and the rows, columns, and diagonals, as thus built up, will 

 continue to be constructed on magical lines provided h and k 

 are chosen so that the same unit-digit does not appear more 

 than once in any row, column, and diagonal. We will suppose 

 that this can be done, and that another cross-step (h, k) of 

 the same form as before enables us to continue filling in the 

 numbers in compliance with the conditions, and that this process 

 can be continued until the square is filled. If this is possible, 

 the whole process will consist of n series of n steps, each series 

 consisting of n — 1 uniform steps (a, b) followed by one cross-step 

 (h, k). The numbers inscribed after the n cross-steps will be 

 n+ 1, 2n+ 1, 3«+ 1, ..., and these will be themselves connected 

 by uniform steps (u, v), where u = (n — l)a + h = k — a, mod. n, 

 and v — (n — l)b + h = k — b. Dela Loubere's rule is equivalent 

 to taking steps a = — 1, 6=1, and cross-steps h = 1, k = 0. 



I proceed to investigate the conditions that a, b, h, and k 

 must satisfy in order that the square can be constructed as 

 above described with uniform steps (a, b) and (h, k). We notice 

 at once that in order to secure the magic property in the rows 

 and columns, we must have a and b prime to n ; and to secure 

 it in the diagonals, we must have a and b unequal and b + a 

 and b — a prime to n. The leading numbers of the n sequences 

 of n numbers, namely 1, n + 1, 2n + 1, ..., are connected by steps 



