Exercise 13. Let $\mathrm{n}$ be a strictly positive integer. Domitille has a rectangular grid divided into unit squares. Inside each unit square is written a strictly positive integer. She can perform the following operations as many times as she wishes:

- Choose a row and multiply each number in the row by $n$.
- Choose a column and subtract $n$ from each integer in the column.

Determine all values of $n$ for which the following property is satisfied:

Regardless of the dimensions of the rectangle and the integers written in the cells, Domitille can end up with a rectangle containing only 0s after a finite number of operations.
Solution to Exercise 13 For $n=1$, if we start from a configuration with one column of two rows, with different integers on these two rows, the difference between the two integers remains invariant when one of the two operations is performed. Consequently, it cannot be canceled. In particular, Domitille cannot arrive at a rectangle containing only 0s in a finite number of steps.

We now assume that $n>2$. Consider the rectangle with one column of two rows, with values 1 and 0. By looking at what happens modulo $n-1$, we see that multiplication by $n$ has no effect, and the second operation preserves the difference between the two values. Thus, the difference between the two values modulo $n-1$ is an invariant, initially non-zero. Consequently, it is impossible to make the two numbers equal $\bmod n-1$, and in particular to make them both zero.

Now let's show that Domitille can always reach 0 in the case $n=2$.

First, reduce the problem. If Domitille can handle the case where there is only one column, it is sufficient for her to deal with the columns one by one. Once a column is brought to 0, the only operation that its cells will undergo when processing the other columns will be the multiplication of a row by $n$. But since the elements of the column are zero, this actually has no effect.

We can therefore assume that the rectangle is in fact composed of only one column. Then, if we can make two cells of the column equal, we can merge them, that is, each time we multiply the row of the first by $n$, we do the same for the second. In this case, the two cells will always contain the same value. We can therefore restrict ourselves to the case where the column contains 2 cells with the integers $a$ and $b$. By multiplying each of the rows by 2, we can actually assume that $a$ and $b$ are even. We then subtract 2 from the smallest until it is 2. This is possible because neither $a$ nor $b$ is zero. Then we apply the "double then subtract" operation: we double the one that is 2, then subtract 2 from the column, until both numbers are 2. We have thus reduced to a configuration where all the numbers in the column are 2. We then subtract 2 from the column, and we have thus nullified the column, which concludes. Note also that the integers in all the other columns remain non-zero during all these manipulations.

Comments from the graders: The problem mainly involved two parts: handling the case $n>2$ and handling the case $n=2$ (without forgetting $\mathrm{n}=1$). The problem was widely addressed and often at least one of the two parts is well handled. The writing of the case $n=2$ is, however, often quite messy.