5. A knight is placed in each cell of a chessboard. What is the smallest number of knights that can be removed from the board so that no knight remains that attacks exactly three other knights? (A knight attacks the squares that are one square away horizontally and two squares away vertically, or vice versa.)
Answer: 8 knights.

Solution 1. We will say that a knight controls a square on the board if it attacks this square or stands on it. First, we will prove that it is impossible to remove fewer than 8 knights. It is sufficient to check that at least 4 knights must be removed from each half of the board. Consider, for definiteness, the upper half and mark six knights on it as shown in the figure:

![](https://cdn.mathpix.com/cropped/2024_05_06_bd69057b1c245517edf6g-02.jpg?height=161&width=299&top_left_y=2027&top_left_x=936)

(for convenience, they are highlighted in different colors). We will call the squares marked with a circle on the figure multiple, and the other squares simple. We will divide the figure into two $4 \times 4$ squares and fix one of them. The black knights standing in the square attack exactly three squares. Therefore, one of the following actions must be performed.

1) Remove two knights standing on simple squares controlled by black knights (they can be the black knights themselves).
2) Remove a knight standing on a multiple square. As a result, the white knight from this square will attack exactly three other knights. Therefore, it will be necessary to remove another knight from a simple square controlled by the white knight (possibly the white knight itself).

The same actions must be performed for the other square. Thus, each square determines a pair of squares in the upper half of the board from which knights need to be removed. These pairs do not intersect, since no two marked knights from different squares control the same squares. In other words, the actions with the squares are performed independently of each other. Therefore, at least four knights will have to be removed from the upper half of the board.

We will provide an example showing that 8 knights are sufficient. The knights that need to be removed from the board are marked on the figure.

![](https://cdn.mathpix.com/cropped/2024_05_06_bd69057b1c245517edf6g-03.jpg?height=294&width=300&top_left_y=681&top_left_x=935)

Solution 2. We will first show that it is necessary to remove at least 8 knights. Mark 12 knights on the board as shown in the left figure:
![](https://cdn.mathpix.com/cropped/2024_05_06_bd69057b1c245517edf6g-03.jpg?height=296&width=950&top_left_y=1125&top_left_x=608)

(for convenience, they are highlighted in different colors). We will call a square useful if it is occupied or attacked by at least one black knight, and useless otherwise. If a square is attacked by two black knights, it is called key (on the left figure, key squares are marked with circles). We will divide the board into four $4 \times 4$ squares. Since black knights attack exactly three squares on the board, the following two facts are true.

1) In each square, at least one useful square must be cleared.
2) If in some square exactly one useful square is cleared, then it must be a key square. Suppose that no more than 7 knights can be removed from the board. Then in some square, exactly one knight will be removed. Let this be, for definiteness, the top-left square. By 2), the knight must be removed from a key square, after which the white knights from this square will attack exactly three knights. Therefore, for each white knight, it will be necessary to clear another square. By assumption, these squares do not lie in the top-left square (and, therefore, they are different). Thus, one of the squares will lie in the bottom-left square, and the other in the top-right square. Obviously, both of them are useless.

By 1), there is at least one cleared square in the top-left and bottom-right squares. Therefore, in the top-right and bottom-left squares, a total of no more than five squares will be cleared. Then in some square (for example, the top-right square), no more than two squares will be cleared. One of them, as shown above, is useless. Therefore, by 1) and 2), another square will be cleared, and it will be a key square. After this, for the white knights standing in the top-right square, it will be necessary to clear two more useless squares - one in the top-left square, and the other in the bottom-right square. In the end, we will clear 4 useless squares (they are different since they lie in different squares), and at least 4 useful squares by 1). Thus, at least 8 knights will be removed, which is impossible.

We will now provide an example showing that 8 knights are sufficient. The knights that need to be removed from the board are marked on the right figure.