# Can you fill $3 \times 3$ magic square?

In the magic square

• Each number in the matrix is unique and natural.
• Each row, column and the two diagonals add up to the same number (the magic constant).

Can you fill in the missing numbers?

$$\begin{bmatrix}?&3&?\\7&11&?\\?&?&?\end{bmatrix}$$

There are two ways to do this: the algebraic way and the 'clever' way.

# The algebraic way

Call the top-left cell $$x$$, and call the total $$n$$. Then, we have:
$$\begin{bmatrix}x&3&n-x-3\\7&11&n-18\\n-x-7&n-14&n-x-11\end{bmatrix}$$ Now, the bottom row and /-ward diagonal give two equations.
$$(n-x-7) + (n-14) + (n-x-11) = n$$ $$(n-x-7) + (11) + (n-x-3) = n$$ Set the two left sides equal to each other, and most things cancel out; some basic algebra gives $$n=33$$, and then $$x=17$$. So the final square is:
$$\begin{bmatrix}17&3&13\\7&11&15\\9&19&5\end{bmatrix}$$

# The clever way

There is only one possible 3x3 magic square, up to linear transformations and dihedral symmetries.

That is, if you have a magic square, you can make another by:
• rotating or flipping it
• scaling all cells by some constant
• adding the same number to all cells
It turns out that all 3x3 magic squares are equivalent under these transformations.

The standard 3x3 magic square, also called the Lo-Shu square, is:
$$\begin{bmatrix}4&9&2\\3&5&7\\8&1&6\end{bmatrix}$$
We can see that both given numbers on the edge are smaller than the center, so they must correspond to the 1 and 3. That is, the square has been flipped vertically. And what linear transformation brings 1 to 3, 3 to 7, and 5 to 11? "double and add one".

So, to get this magic square, you take the Lo-Shu square, flip it vertically, double every number, and then add one to every number. The result is:
$$\begin{bmatrix}17&3&13\\7&11&15\\9&19&5\end{bmatrix}$$

• Wow. First time I hear of this property that 3x3 magic square are all equivalent under an affine transformation. Thanks for mentioning it. – Florian F Jun 27 at 15:11