Problem 7.6. A magic square is a $3 \times 3$ table in which numbers are arranged so that the sums of all rows, columns, and the two main diagonals are the same. The figure shows a magic square in which all numbers except three have been erased. Find what the number in the upper left corner of the square is.

| $?$ | 31 | 9 |
| :---: | :---: | :---: |
| 13 |  |  |
|  |  |  |
Answer: 14.

Solution. Let the unknown number be $x$, then the sums in all rows, columns, and on the main diagonals are $9+31+x=40+x$.

1) Considering the left column, we get that the number in the lower left corner of the square is 27.
2) Considering the main diagonal going up to the right, we get that the number in the center of the square is $4+x$.
3) Considering the main diagonal going down to the right, we get that the number in the lower right corner of the square is $36-2x$.
4) Considering the right column, we get that the number in the middle cell of this column is $2x-5$.
5) Considering the middle row, we get the necessary equation for $x$:

$$
40+x=13+(4+x)+(2x-5)
$$

Solving it, we find $x=14$.