Problem

Source: Bulgaria NMO 2022 P1

Tags: combinatorics, Parity, colouring



A white equilateral triangle $T$ with side length $2022$ is divided into equilateral triangles with side $1$ (cells) by lines parallel to the sides of $T$. We'll call two cells $\textit{adjacent}$ if they have a common vertex. Ivan colours some of the cells in black. Without knowing which cells are black, Peter chooses a set $S$ of cells and Ivan tells him the parity of the number of black cells in $S$. After knowing this, Peter is able to determine the parity of the number of $\textit{adjacent}$ cells of different colours. Find all possible cardinalities of $S$ such that this is always possible independent of how Ivan chooses to colour the cells.