In a $13 \times 13$ table, numbers were written in such a way that the sum of the numbers in each of the 13 rows and each of the 13 columns is the same. What is the minimum number of numbers that need to be changed in the table so that there are no equal sums among the 26 sums?
Solution. At most one of the 26 row and column sums can remain unchanged, so we either change a number in every row or every column. We can assume that we change (at least one) number in every row. This already amounts to at least 13 changes. Suppose that after initially changing 1 in each row, that is, after a total of 13 changes, we make at most three more changes. These (at most) three changes fall into 1, 2, or 3 rows. Let $x$ be the number of rows in which these three changes occur. In these $x$ rows, there are $x+3$ altered cells, which can change the sums of at most $x+3$ columns.

In the remaining $13-x$ rows, we changed exactly one cell each. Take one of these. Since no two sums can be the same, there must be at least one more change in the column of this cell. This implies that the changes in these rows can alter the sums of at most $\frac{13-x}{2}$ columns outside the previously mentioned $x+3$ columns. Therefore, we have that the sums of at most $x+3+\frac{13-x}{2}=9.5+\frac{x}{2}$ columns can be changed, which is at most 11. This means that at least 2 column sums remain unchanged, leading to a contradiction. Similarly, we can reach a contradiction if we make only 0, 1, or 2 changes after the "mandatory" 13. Therefore, at least $13+4=17$ changes are needed. However, 17 changes are also sufficient, for example, with the following increments:

![](https://cdn.mathpix.com/cropped/2024_05_02_6bb48bb19171dbd16c32g-1.jpg?height=577&width=575&top_left_y=801&top_left_x=772)