5
$\begingroup$

A magic square consists of the numbers $1,2,\ldots,m^2$ placed into $m\times m$ square grid, so that every row, column, and both diagonals have the same sum. The magic constant of the square is this common sum.

Based on the dimensions of an $m\times m$ square, can you determine what the magic constant is? If so, how can you do that? If not, please explain why it isn't possible.

For example, here are some magic square "magic constants";

$1\times 1\,\to\, 1 $
$2\times 2 \,\to nil$
$3\times 3\,\to \,15$
$4\times4\,\to\, 34$
$5\times 5 \,\to\, 65$

How can you determine the $6\times 6$, $7\times7$, etc. just from the dimensions?

Please note; I'm not asking for how to solve an $m\times m$ magic square, nor do I want a "trial and error" answer. I want a mathematical based answer explaining how to figure out the magic constant of a magic square with the dimensions $m\times m$.

$\endgroup$
1
  • $\begingroup$ @Jul For future reference, without enough rep, your edits have to be approved, so feel free to edit, your "permission" is the approval of the OP or mods. If you do however have enough rep to edit without permission, you should know what you're doing now shouldn't you? $\endgroup$
    – warspyking
    Commented Dec 5, 2014 at 1:28

2 Answers 2

8
$\begingroup$

According to wikipedia, you're talking about a Magic Sum. Let's say the formula for finding this number is:

$\text{MagicSum} = \begin{cases} 1 & \mbox{if }n = 1 \\ n\Big( \frac{n^2 +1}{2}\Big) & \mbox{if }n> 2 \\ \text{undefined} & \mbox{else}\end{cases} \\ $

$\endgroup$
1
  • 1
    $\begingroup$ $n\left(\frac{n^2+1}{2}\right) = 1$ at $n=1,$ so this could be simplified to if $n \ne 2$ and "else". $\endgroup$ Commented Nov 24, 2018 at 2:00
10
$\begingroup$

Given an $n\times n$ magic square, write $M_n$ for its magic constant. There are $n$ rows, each of which has sum $M_n$, so the sum of all the entries in the square is $n \cdot M_n$. Each whole number between $1$ and $n^2$ appears once, so $$ \begin{gather} n\,M_n=1+2+\ldots+n^2=\frac{n^2(n^2+1)}{2},\\ M_n = \frac{n(n^2+1)}{2}. \end{gather} $$ In particular, every $n\times n$ magic square has the same constant.

$\endgroup$
10
  • $\begingroup$ That last sentence didn't answer my question at all… $\endgroup$
    – warspyking
    Commented Dec 5, 2014 at 0:54
  • $\begingroup$ The equation before it gives a formula for the magic constant of an $n\times n$ magic square in terms of the size. $\endgroup$ Commented Dec 5, 2014 at 0:55
  • $\begingroup$ What would the result of 2 be? $\endgroup$
    – warspyking
    Commented Dec 5, 2014 at 0:59
  • 2
    $\begingroup$ That's what I mean by "vacuosly true". A statement about every object of a certain kind is always true if there are no objects of that kind. $\endgroup$ Commented Dec 5, 2014 at 1:05
  • 1
    $\begingroup$ The Wikipedia article on magic squares says they exist for all sizes except $2\times 2$ $\endgroup$ Commented Dec 5, 2014 at 1:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.