# a question on magic square

A magic square of order $N$ is an $N\times N$ matrix with positive integral entries such that the elements of every row, every collumn and the two diagonals all add up to the same number. If a magic square is filled with numbers in AP starting with $a\in\mathbb{N}$ and common difference $d\in \mathbb{N}$ what is the value of this common sum? I am thinking that it is just a sum of the AP given? I mean $\frac{N}{2}[2a+(N-1)d]$, am I right?

-

Let $s$ be the common sum. Then each row sums to $s$, and there are $N$ rows, so the sum of all the numbers in the square is $Ns$. That is,

$$\frac{N^2}2\Big(2a+(N^2-1)d\Big)=Ns\;,$$

and $$s=\frac{N}2\Big(2a+(N^2-1)d\Big)\;.$$

(Note that you miscounted the number of terms in the sequence when you wrote down your expression for the sum.)

-
I dont understand why you have written $(N^2-1)$, as total number of entries $N^2$ thatswhy? – La Belle Noiseuse Oct 3 '12 at 8:14
@Flute: Yes: the arithmetic progression has $N^2$ terms, so if $a$ is the first term and $d$ the common difference, the last term is $a+(N^2-1)d$. – Brian M. Scott Oct 3 '12 at 8:22
thank you Brian – La Belle Noiseuse Oct 3 '12 at 8:23
@Flute: You’re welcome. – Brian M. Scott Oct 3 '12 at 8:28