How can I find all the different possibilities for the sum of rows/columns/diagonals for a $4\times4$ magic square? I am not sure how to proceed, except by brute force, which is entirely inelegant.

I should mention that I am looking at a $4\times 4$ magic square with symbols from $0$ to $15$ inclusive.

  • $\begingroup$ Do you really mean that you want the possibilities for the sum of the rows? If a magic square contains the integers 1–16, then there is only one possibility, namely $\frac14(1+\ldots+16) = 34$; if the square is allowed to contain any positive integers, then any sum is possible. And do you mean a magic square, or a Latin square? They are not the same thing. $\endgroup$ – MJD Jul 18 '12 at 22:08
  • $\begingroup$ See the edit on the question. As I said I could not find he magic square tag. $\endgroup$ – Xuan Huang Jul 18 '12 at 22:34
  • $\begingroup$ Also how might we go about proving that 34 is the only possibility? $\endgroup$ – Xuan Huang Jul 18 '12 at 22:38
  • $\begingroup$ The numbers from 0 to 15 add up to 120. In a magic square, all the rows have the same sum. The four row sums must add up to that 120, so each must be 30. As noted, a Latin square is an entirely different thing. $\endgroup$ – Gerry Myerson Jul 18 '12 at 22:52
  • $\begingroup$ @DanielleHuang Count the same thing two different ways: if the row sum is $r$, then the sum of all the entries in the square must be the sum of row 1, row 2, row 3, and row 4: $r+r+r+r=4r$. Meanwhile, if the square contains each of the numbers from 0 through 15 (or 1 through 16) exactly once, then the sum of all the entries is... $\endgroup$ – Steven Stadnicki Jul 18 '12 at 22:53

There is only 1 possible sum : What are the possible sums of an $n \times n$ magic square? That sum would be 30 in a 4x4 magic square with numbers 0-15


| 0 | 7 |11|12|

|13|10| 6 | 1 |

|14| 9 | 5 | 2 |

| 3 | 4 | 8 |15|


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.