Two players play a game with $n$ counters. Taking turns,
each player must remove a number of counters which is a power of $d$. The
person who removes the last counter wins. For any general value of $d$,
determine for which values of $n$ the first player has a winning strategy,
and for which values of $n$ the second player wins.
Attempt case $d=2$: in this case I sum the binary version of $n$ and if it is even the first player loses, if odd they win.
Best Answer
We will split natural numbers into two sets, winning $W$ and losing $L$, with properties:
Then it's clear that 1st player wins iff $n \in W$.
We can take $W$ and $L$ such as:
Note that if $d$ is odd, then $W$ is just set of all odd numbers, $L$ is set of all even numbers, and strategy doesn't matter: any move that takes even number gives an odd, and vice versa.