A magic square is a NxN square grid filled with distinct positive integers in the range 1,2...$N^2$.
Each cell contains a different integer.
The sum of the integers in each row, column and diagonal is equal and called magic constant.
The Formula for magic constant is given by
Magic Constant=$\frac{N*(N^2+1)}{2}$
How to derive this formula?