# Common sum in magic square

A magic square of size $$N,N ≥ 2$$, is an $$N ×N$$ matrix with integer entries such that the sums of the entries of each row, each column and the two diagonals are all equal. If the entries of the magic square are made up of integers in arithmetic progression with first term a and common difference d, what is the value of this common sum?

My attempt for this question is Suppose i took $$n^2$$ numbers as $$a, a+d,a+2d,...a+(n^2-1)d$$ and now i want to put these numbers in n×n square matrix such that sum of each row and sum of each column and sum of each diagonal is same. So i want to know what is value of that common sum?

• Welcome to MSE. It will be more likely that you will get an answer if you show us that you made an effort. This should be added to the question rather than in the comments. Sep 12, 2018 at 8:16
• I can't flag this, but this is an exact duplicate of Magic square with number theory and sequences & series. Sep 12, 2018 at 8:27

You can add up all the entries in the square.

$$a+(a+d)+ \cdots + a+(n^2-1)d = S.$$

If the sum of the entries in each column is $C$ then you have

$$NC = S.$$

You have to just sum the series
$$a,a+d,a+2d,\cdots,a+(N^2-1)d$$

$$S=\frac{N^2}{2}\cdot(2a+(N^2-1)d)$$

Sum of all columns is same Thus sum of one column is $$S=\frac{N}{2}\cdot(2a+(N^2-1)d)$$

• My attempt for this question is Suppose i took n^2 numbers as a, a+d,a+2d,...a+(n^2-1)d and now i want to put these numbers in n×n square matrix such that sum of each row and sum of each column and sum of each diagonal is same. So i want to know what is value of that common sum? Sep 12, 2018 at 12:06
• This doesn't work. For a $3\times 3$ using $1, 2, \ldots 9$, the column sum is $15$. Your formula gives $6$. Sep 12, 2018 at 12:14
• this is sum of only one row Sep 12, 2018 at 13:36
• No it isn't. It's the sum of the smallest $N$ entries, which will certainly not be in the same row. Sep 12, 2018 at 13:39
• ok so you answer is good sum all the entries I like your aproach Sep 12, 2018 at 13:40