# 9-by-9 filled, magic square

Construct a 9-by-9 filled, magic square using the integers from 0 to 80. The magic square should additionally have the property that when it is divided into ninths according to the picture below, each 3-by-3 subsquare is also magic.

• I am thinking it would be beneficial to define a "magic square" somewhere in the problem or a link to its definition... – Warlord 099 Feb 20 '15 at 19:43
• @Warlord You can always check the tag summary or tag wiki (which is accessible by clicking on the tag in the tags list). – user20 Feb 20 '15 at 20:12

Here's the solution I created:

$$\begin{array}{ccc|ccc|ccc} 70 & 63 & 68 & 7 & 0 & 5 & 52 & 45 & 50\\ 65 & 67 & 69 & 2 & 4 & 6 & 47 & 49 & 51\\ 66 & 71 & 64 & 3 & 8 & 1 & 48 & 53 & 46\\\hline 25 & 18 & 23 & 43 & 36 & 41 & 61 & 54 & 59\\ 20 & 22 & 24 & 38 & 40 & 42 & 56 & 58 & 60\\ 21 & 26 & 19 & 39 & 44 & 37 & 57 & 62 & 55\\\hline 34 & 27 & 32 & 79 & 72 & 77 & 16 & 9 & 14\\ 29 & 31 & 33 & 74 & 76 & 78 & 11 & 13 & 15\\ 30 & 35 & 28 & 75 & 80 & 73 & 12 & 17 & 10 \end{array}$$

How did I get here?

First step: I took the solution of a regular 3x3 magic square which I have solved before:

$$M_0 = \left[\begin{array}{ccc} 7 & 0 & 5 \\ 2 & 4 & 6 \\ 3 & 8 & 1\end{array}\right]$$

Second step:

I took the next set of 9 numbers and simply added 9 to all cells of the previous 3x3 magic square I have. For example:
$$M_1 = 1*9 + M_0 = \left[\begin{array}{ccc} 16 & 9 & 14 \\ 11 & 13 & 15 \\ 12 & 17 & 10\end{array}\right]$$
You will notice it is just the previous square; the only change is that I've added $9$ to each cell. This is repeated again:
$$M_2 = 9 + M_1 = 2*9 + M_0 = \left[\begin{array}{ccc} 25 & 18 & 23 \\ 20 & 22 & 24 \\ 21 & 26 & 19\end{array}\right]$$

This is then repeated for the six remaining magic squares.

Then the third step:

Now, how do we compile all 9 of these 3x3 magic squares we have to make the perfect 9x9 magic square? To make it easy to understand, we place them like we do in a ordinary 3x3 magic square.
$$\begin{array}{c|c|c} M_7 & M_0 & M_5 \\\hline M_2 & M_4 & M_6 \\\hline M_3 & M_8 & M_1\end{array}$$