5. Tom Sawyer took on the task of painting a very long fence, adhering to the condition: any two boards, between which there are exactly two, exactly three, or exactly five boards, must be painted in different colors. What is the smallest number of different colors he can manage with.
Answer: Three. Solution. Note that between the first and fourth, and the fourth and seventh boards, there are two boards each, and between the first and seventh boards, there are five boards. Therefore, the first, fourth, and seventh boards of the fence must be painted in different colors, so Tom will need at least three different paints. On the other hand, three colors will be enough for him, for example, if he paints like this: AAABBBCCCAAABBBCCC...: here, between any two same-colored boards, there are at least 6 boards.

Grading Guidelines. Only the answer - 0 points. Proven that two colors are not enough, but no example for three colors - 3 points. Only a correct example for three colors without explanation of why it works - no more than 3 points (3 points if the explanation is obvious, as in our example, and from 0 to 2 points otherwise, depending on the complexity of the justification). Proven that two colors are not enough and provided a correct example, but without explanation of why it works - from 5 to 7 points, depending on the complexity of the justification.