5. In each cell of a $2017 \times 2017$ board, there is a chip. In one operation, you can remove a chip that has a non-zero even number of neighbors (neighbors are chips located in cells that share a side or a corner). What is the minimum number of chips that can be left on the board using such operations?

#
# Answer: 2

Solution. If there are only two chips on the board, then each of them has no more than one neighbor, and according to the rules, they cannot be removed. Therefore, at least two chips will remain. We will show how to leave exactly two chips on the board. For this, we will provide an algorithm that allows clearing two adjacent rows (or two adjacent columns) on an $m \times n$ board. Let's assume we want to clear the top two rows. We will number the cells from 1 to $n$. First, we will remove the chip from the 2nd cell of the second row (this can be done because it has 8 neighbors), then we will remove the corner chip (it now has 2 neighbors), then the 3rd chip from the first row (it has 4 neighbors), then the 2nd chip from the first row (it has 2 neighbors), and the 1st chip from the second row (it also has 2 neighbors). Next, moving from left to right, we will sequentially remove all the chips from the first row (each of them will have 4 neighbors at the moment of removal, except for the last one, which will have 2 neighbors), and then similarly remove the chips from the second row. This way, we will clear the two top rows. We will apply these actions sequentially, alternating between rows and columns, until only the chips in a $3 \times 3$ square remain. Dealing with them is quite simple: we remove the central one, then the four corner ones in any order, then the remaining top one, and finally, the remaining bottom one.