On the congruences connected with certain magic squares
Derrick Norman Lehmer · Transactions of the American Mathematical Society · 1929
The familiar uniform method of constructing squares with odd number of cellst depends on certain interesting congruences which seem not to have been studied. By means of them one is able to state in very simple form the necessary and sufficient conditions that a constructed with a given step and a given break-step shall be diabolic, or completely or in part. A containing the numbers 1, 2, 3, , n2 is said to be in the rows if the sum of the numbers in each row is the same. Since the sum of all the numbers in the is n2(n2+1)/2 the sum in each row must be n(n2+1)/2. Similarly for the columns. A magic square is in both rows and columns. If the numbers in the diagonal from the upper left hand corner to the lower right hand corner as well as the numbers in any two partial diagonals parallel to it which together make up n numbers is the same the is said to be in the positive diagonals. If it is also in the negative diagonals the is called diabolic. If further the sum of the two numbers in any two cells symmetrically placed with respect to the center cell is the same the is said to be symmetric. As an illustration of a which is magic, diabolic and symmetric one may take