5. Petya and Vasya are playing a game, taking turns naming non-zero decimal digits. One cannot name a digit that is a divisor of any of the digits already named by anyone. The player who has no move loses. Petya starts. Who wins with correct play from both sides?

For a complete solution to each problem, 7 points are awarded

The maximum score is 35
5. Answer: Petya wins.

Consider the same game but with digits from 2 to 9. It lasts a finite number of moves, and there are no draws. Therefore, one of the players has a winning strategy.

Consider the case when in the new game, the one who starts wins. Then he makes the first move by naming some digit \( a \neq 1 \), and subsequently wins. Then Petya can simply name the same number \( a \) in the original game. One divides any number, and it cannot be named again, so the game proceeds exactly as the previous one. Therefore, Petya wins.

Now consider the case when in the new game, the one who starts loses. Then Petya in the original game names the number 1. The game then continues exactly as the game with digits from 2 to 9, but in it, Vasya makes the first move. Therefore, he loses, and Petya wins.

Note that the correct strategy for the game is not immediately known: only the existence of such a strategy is proven. Analysis of the game conducted using a computer shows that Petya wins with any of the three initial moves: he can name either 2, or 5, or 7. But the game instructions themselves are quite complex.