5. There are 111 pebbles in a pile. Petya and Vasya are playing a game: they take turns taking any number of pebbles from the pile, but no more than 9. Skipping a turn is not allowed. The player who takes the last pebble wins. Petya goes first. Who will win with correct play, and how should he play?
Solution. Petya will win. He needs to take one pebble, leaving Vasya with 110. Then, in response to any move by Vasya, he should take enough pebbles to leave a number of pebbles that is a multiple of 10 before Vasya's next move. This is always possible because Vasya takes between 1 and 9 pebbles, and therefore cannot reduce the number of pebbles by 10, nor can he leave the number of pebbles unchanged. On his last move, Vasya will take some number of pebbles from the remaining 10. Petya will then take all the remaining pebbles after Vasya's move, as their number will be in the range from 1 to 9.

Answer. Petya will win.