What should be the winning strategy for Bob? Alice and Bob are playing a calculator game in which the calculator can only display positive integers and is used like this: starting with the integer $x$ one player types an integer $1<=y<=99$ in and if $y\%$ of $x$ (meaning $\frac{xy}{100}$) is again an integer the calculator shows that result, otherwise the job fails and the one whose turn it was loses. How many starting numbers $1<=x<=2017$ guarantee a winning strategy for Bob who plays second?
 A: Let $x = 2^a \cdot 5^b$ and $y = 2^c \cdot 5^d$, each round the calculator does $\frac{xy}{100} = 2^{a+c-2} \cdot 5^{b+d-2}$. The goal is to either reduce both exponents to zero so the opponent can't reach another integer or to reduce them just enough so the opponent can't win in the next move. Essentially there are $14$ moves (or $y$-values):
$$\begin{array}{c|c|c} y & c-2 & d-2 \\ \hline 1 & -2 & -2 \\ 2 & -1 & -2 \\ 5 & -2 & -1 \\ 10 & -1 & -1 \\ \hline 4 & \pm 0 & -2 \\ 20 & \pm 0 & -1 \\ 25 & -2 & \pm 0 \\ 50 & -1 & \pm 0 \end{array} \qquad \begin{array}{c|c|c} y & c-2 & d-2 \\ \hline 8 & +1 & -2 \\ 16 & +2 & -2 \\ 32 & +3 & -2 \\ 64 & +4 & -2 \\ 40 & +1 & -1 \\ 80 & +2 & -1 \end{array}$$
If the starting number is not divisible by $2$ or $5$, Alice would lose on the first move. There are only $33$ tuples $(a,b)$ for which $x<2017$ and the only ones where Bob has a guaranteed winning strategy are
$$(3,0) \to x = 8 \quad (6,0) \to 64 \quad (9,0) \to 512 \quad (0,3) \to 125 \quad (3,3) \to 1000$$
In the words of gnasher729's answer, call them "losers" for Alice. All other tuples can be reduced in one move to these and become therefore "losers" for Bob. So the starting numbers from the tuples above for which Bob can win are $n \cdot 2^a \cdot 5^b$ with $n$ not divisible by $2$ or $5$, and according to my calculations there are $123$ of them
A: We classify numbers x into "winners" and "losers". x is a loser if for every 1 < y < 99 either (x * y) / 100 is not an integer or it is a winner; x is a winner if there is an y such that (x * y) / 100 is an integer and a loser.
If x is a multiple of 2 or 5 then I can enter y = 50 or y = 20 and survive the next round; if x is neither a multiple of 2 or of 5 then (x * y) / 100 is not an integer for any y < 100. Any x not divisible by either 2 or 5 is a loser.
If x is divisible by 2 or 5, then replacing x with (x * y) / 100 MUST remove one factor 2 or 5, and can remove factors up to 2^2, and up to 5^2, but not both at the same time. So unless x is divisible by 8 or 125 or 100, the player can leave a loser. Any x divisible by 2 or 5, but not divisible by 8, 125 or 100 is a winner.
If x is divisible by 8 but not 16 or 5, or divisible by 125 but not 625 or 2, or divisible by 100 but not 200 or 500, then the player is forced to leave a winner, so any such x is a loser. We continue this and classify all x as "winners" or "losers", then we count the number of "losers" from 1 to 2017.
