Problem 1. Ana and Bernardo are playing the following game. They start with a bag containing $n \geq 1$ stones. On successive turns, starting with Ana, each player can make the following moves: if the number of stones in the bag is even, the player can take one stone or half of the stones. If the number of stones in the bag is odd, the player must take one stone. The goal of the game is to take the last stone. Determine for which values of $n$ Ana has a winning strategy.
Solution. Ana has a winning strategy for $n=1,3$ and for all even numbers greater than 3. First, we observe that in the cases $n=1,2,3$ all moves are determined and Ana wins when $n=1$ or $n=3$. If the initial number of stones is even and greater than 4, Ana can take one stone, which forces Bernardo to take only one as well. This way, Ana can force the situation to reach 4 stones in the bag on her turn. In this case, Ana takes 2 stones, leaving Bernardo in a losing position, and thus Ana wins the game.

Similarly, if the game starts with an odd number of stones greater than 4, Ana must necessarily take one stone, which leaves Bernardo in a winning position. Consequently, Ana can only win if $n=1,3$ or the number is even and greater than 3.