Abby and Brian play the following game: They first choose a positive integer $N$. Then they write numbers on a blackboard in turn. Abby starts by writing a 1. Thereafter, when one of them has written the number $n$, the other writes down either $n+1$ or $2 n$, provided that the number is not greater than $N$. The player who writes $N$ on the blackboard wins.

(a) Determine which player has a winning strategy if $N=2011$.

(b) Find the number of positive integers $N \leqslant 2011$ for which Brian has a winning strategy.
(a) Abby has a winning strategy for odd \( N \): Observe that, whenever any player writes down an odd number, the other player has to write down an even number. By adding 1 to that number, the first player can write down another odd number. Since Abby starts the game by writing down an odd number, she can force Brian to write down even numbers only. Since \( N \) is odd, Abby will win the game. In particular, Abby has a winning strategy if \( N=2011 \).

(b) - Let \( N=4 k \). If any player is forced to write down a number \( m \in \{k+1, k+2, \ldots, 2 k\} \), the other player wins the game by writing down \( 2 m \in \{2 k+2, 2 k+4, \ldots, 4 k\} \), for the players will have to write down the remaining numbers one after the other. Since there is an even number of numbers remaining, the latter player wins. This implies that the player who can write down \( k \), i.e., has a winning strategy for \( N=k \), wins the game for \( N=4 k \).

- Similarly, let \( N=4 k+2 \). If any player is forced to write down a number \( m \in \{k+1, k+2, \ldots, 2 k+1\} \), the other player wins the game by writing down \( 2 m \in \{2 k+2, 2 k+4, \ldots, 4 k+2\} \), as in the previous case. Analogously, this implies that the player who has a winning strategy for \( N=k \) wins the game for \( N=4 k+2 \).

Since Abby wins the game for \( N=1,3 \), while Brian wins the game for \( N=2 \), Brian wins the game for \( N=8,10 \), as well, and thus for \( N=32,34,40,42 \), too. Then Brian wins the game for a further 8 values of \( N \) between 128 and 170, and thence for a further 16 values between 512 and 682, and for no other values with \( N \leqslant 2011 \). Hence Brian has a winning strategy for precisely 31 values of \( N \) with \( N \leqslant 2011 \).