A $3 \times 3$ table was filled with the numbers $1,2, \ldots, 9$ in such a way that the sum of the numbers within each of the four $2 \times 2$ squares is the same. What could this sum be?
Solution. Let the desired sum be $S$, and denote the numbers written in the table by the letters $a, b, c, d, e, f, g, h, i$ as shown in the following diagram:

| $a$ | $b$ | $c$ |
| :---: | :---: | :---: |
| $d$ | $e$ | $f$ |
| $g$ | $h$ | $i$ |

If we add the sums of the numbers within the $2 \times 2$ squares, then the numbers in the corner cells are counted once, the number in the center cell is counted four times, and the numbers in the remaining four cells are counted twice. Since the sum of all numbers is $1+2+\ldots+9=45$, we have $4 S=45+3 e+(b+d+f+h)$. Since the numbers $b, d, e, f, h$ are distinct elements of the set $\{1,2, \ldots, 9\}$, we have

$$
3 e+(b+d+f+h)=2 e+(b+d+e+f+h) \geq 2 \cdot 1+(1+2+3+4+5)=17
$$

since $e \geq 1$ and the sum $(b+d+e+f+h)$ is at least as large as the sum of the five smallest elements. Thus, $4 S \geq 45+17=62$, and therefore $S \geq 16$, since $S$ is an integer.

Now consider a filled table that satisfies the condition, and in which the sum of the numbers in each $2 \times 2$ square is $S$. Replace each element $x$ with $10-x$, then the numbers written in the table will again be $10-9=1,10-8=$ $2, \ldots, 10-1=9$. Moreover, it still holds that the sum of the numbers in any $2 \times 2$ square is the same: its value is $40-S$, since if the numbers $x, y, z, t$ were originally in some $2 \times 2$ square, where $x+y+z+t=S$, then they are replaced by $10-x$, $10-y, 10-z, 10-t$, and their sum is $40-(x+y+z+t)=40-S$. We know that in any valid table, $S \geq 16$, so since the previous swap also results in a table where the sum of the numbers in the $2 \times 2$ squares is the same, $40-S \geq 16$ also holds. Thus, $16 \leq S \leq 24$, meaning that $S$ can only be an integer in the interval [16,24]. These values are indeed possible, as shown by the following fillings:

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


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


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


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


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

These 5 tables provide examples for the values $S=16,17,18,19,20$. The mentioned swap can be used to obtain valid tables for the complementary values, i.e., $S=24,23,22,21$. Therefore, the sum of the numbers in the $2 \times 2$ sub-tables can be $16,17, \ldots, 24$.