## 4. Magic Square

In each cell of the table in the picture, one of the numbers $1,2,3,4,5,6$, 7, 8, and 9 is written. The sums of the three numbers in the cells of each row and each column are equal. In the central cell of the table, the number 3 is located. Let $A$ be the sum of the numbers in the cells marked with a circle, and $B$ be the sum of the numbers in the cells marked with a triangle. What is the value of $A \cdot B$?

![](https://cdn.mathpix.com/cropped/2024_05_30_97e0360945497c9bac66g-2.jpg?height=328&width=323&top_left_y=1298&top_left_x=1529)

## Result: $\quad 432$
Solution, first method.

Since

$$
1+2+3+4+5+6+7+8+9=45
$$

and the table has three rows (and three columns), the sum of the numbers in each row (and in each column) must be

$$
45: 3=15
$$

The sum of the numbers in the second row is 15, which means the sum of the numbers in the cells with a green circle in that row is 12. Similarly, we conclude that the sum of the numbers in the cells with a green circle in the second column is also 12. The sum of the numbers written in all four cells marked with a circle is

$$
\begin{gathered}
A=12+12 \\
B=45-(24+3)=45-27=18
\end{gathered}
$$

$$
A \cdot B=24 \cdot 18=432
$$

Solution, second method.

Since

$$
1+2+3+4+5+6+7+8+9=45
$$

and the table has three rows (and three columns), the sum of the numbers in each row (and in each column)

must be $45: 3=15$.

Fill in the table so that the sums of the numbers in all rows and columns are equal to 15. The sum of the two missing numbers in the middle row/column must be $15-3=12$.

It holds that $12=5+7=3+9$, and these are the only ways to get a sum of 12.

Let's say the numbers 5 and 7 are in the middle row, and 3 and 9 are in the middle column:

|  | 8 |  |
| :--- | :--- | :--- |
| 5 | 3 | 7 |
|  | 4 |  |

Complete the table with the remaining numbers:

| 1 | 8 | 6 |
| :--- | :--- | :--- |
| 5 | 3 | 7 |
| 9 | 4 | 2 |

Calculate:

$$
\begin{aligned}
& A=8+5+7+4=24 \\
& B=1+6+9+2=18 \\
& A \cdot B=24 \cdot 18=432
\end{aligned}
$$