The following note was prompted by the introductory remarks on magic squares in the stimulating source-book on linear algebra by T. J. Fletcher.
Let M(n) denote the vector space (over the rationals Q) of all nxn matrices with rational entries. Then a matrix A ∈ M(n) is said to be magic if all rows, all columns and both main diagonals of A have the same sum. Thus, as a trivial example, if B denotes the matrix all of whose entries are 1, then qB is magic for any q ∈ Q. We will denote the set of all nxn ‘magic-matrices’ by Mag(n); it is a straightforward exercise to check that Mag(n) is a subspace of M(n), and the purpose of this note is to give a reasonably efficient computation of its dimension.