Problem

Source: Swiss TST/Latvian TST for Baltic Way 2022 P5

Tags: combinatorics, square grid, grid



Let $n \ge 2$ be a positive integer. An $n\times n$ grid of squares has been colored as a chessboard. Let a move consist of picking a square from the board and then changing the colors to the opposite for all squares that lie in the same row as the chosen square, as well as for all squares that lie in the same column (the chosen square itself is also changed to the opposite color). Find all values of $n$ for which it is possible to make all squares of the grid be the same color in a finite sequence of moves.