You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A magic square of order $n$ is an $n\times n$ array using each one of the numbers $1,2,3,\ldots,n^2$ once and such that the sum of the numbers in each row, column or main diagonal is the same.
Example:
\begin{equation*}
\begin{pmatrix}
8 & 1 & 6\\
3 & 5 & 7\\
4 & 9 & 2
\end{pmatrix}
\end{equation*}
It's easy to prove that the sum is always $\frac{1}{2}n(n^2+1)$. So in the example with $n=3$ the sum is always $\frac{1}{2}(3\times 10)=15$.
One way to generalize this concept is to allow any numbers in the entries, instead of $1,2,\ldots,n$.