In a line, there are 2020 white stones and one black stone. A possible operation is as follows: choose a black stone that is not at the edge and change the color of its neighboring stones. Find all possible initial positions for the black stone such that it is possible to color all the stones black with a finite number of operations.
We number the stones from 1 to 2021. Let $f(i)$ be the number of black stones to the right of the $i$-th white stone. We define $g$ as follows:

- $g(i)=0$ if the $i$-th stone is black
- $g(i)=(-1)^{f(i)}$ if the $i$-th stone is white

The sum $S=\sum a_{i}$ is invariant: indeed, performing an operation on the stone $i$ does not change $f(j)$ for $j<i$ or $j>i+1$. We also verify that $g(i-1)+g(i+1)$ does not change. Thus, the only initial position that works is $\overbrace{w w w \ldots w w w}^{1010} b \overbrace{w w w \ldots w w w}^{1010}$.

Next, we need to show that this configuration works. For this, we can proceed by induction to show that starting with a black stone in the middle of a line of $2n+1$ stones allows all stones to be colored black. For $n=0$, this is clear.

If this is true for the integer $n$, we consider $2n+3$ stones with a black stone in the middle. We start by applying the induction hypothesis to have the stones numbered 2 to $2n+2$ colored black. Then we use the stone numbered 2, then 4, and so on up to $2n+2$ to color everything black.

Thus, we have shown that with 2021 stones, it is possible to color everything black if and only if the black stone is placed in the middle.