Question 29
In every cell of a table $n \times n$, $n \geq 2$, one of the numbers $+1$ and $-1$ is written. The cell on the $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".
| +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".