Problem 10.4. In every cell of a table $n \times n, n \geq 2$, one of the numbers +1 and -1 is written. The cell on $i$-th row and $j$-th column is denoted by $(i, j)$, $i, j=0,1, \ldots, n-1$. The neighbors of the cell $(i, j)$ are the cells $(i, j-1)$, $(i, j+1),(i-1, j)$ and $(i+1, j)$, where the numbers are taken modulo $n$. At each step one replaces the number in each cell with the product of the numbers in the four neighbors of that cell. For example,

| +1 | -1 | +1 |
| :---: | :---: | :---: |
| +1 | -1 | -1 |
| -1 | +1 | -1 |$\rightarrow$| +1 | -1 | -1 |
| :--- | :--- | :--- |
| -1 | +1 | +1 |
| -1 | +1 | +1 |.

A table is called "good" if after finitely many steps one obtains the table with +1 in every cell. Find all values of $n$ such that every table $n \times n$ is "good".

Ivan Landjev
10.4. We first prove that for any odd $n \geq 3$ there are $n \times n$ tables that are not "good". Consider an arbitrary $n \times n$ table and denote by $P_{i}, i=1,2, \ldots, n$, the product of the numbers in the $i$-th row at the second last step. Then $P_{1} P_{3}=P_{2} P_{4}=\cdots=P_{n-1} P_{1}=P_{n} P_{2}=1$ and since $n$ is odd, it follows that $P_{1}=P_{2}=\cdots=P_{n}$. This argument shows that the row products in the initial table must be equal. Therefore any table which has not this property is not "good".

We now consider a table of order $n=2^{k} m$, where $m$ is an odd number and $k \geq 1$. After the first two steps the number in the position $(i, j)$ becomes equal to the product of the numbers in the positions $(i-2, j),(i, j-2),(i, j+2)$ and $(i+2, j)$. Therefore the resulting table after every even step can be obtained by applying the operation on the following four tables of order $2^{k-1} \mathrm{~m}$ :

- the table of all $(i, j)$ with $i \equiv j \equiv 0(\bmod 2)$;
- the table of all $(i, j)$ with $i \equiv 0(\bmod 2), j \equiv 1(\bmod 2)$;
- the table of all $(i, j)$ with $i \equiv 1(\bmod 2), j \equiv 0(\bmod 2)$;
- the table of all $(i, j)$ with $i \equiv j \equiv 1(\bmod 2)$.

Now it follows by induction that the number $n=2^{k} m$ has the required property if and only if the number $2^{k-1} m$ does. It is also easy to see that every table of order 2 is "good".

Therefore the required $n$ are $n=2^{k}$, where $k$ is a positive integer.