Removing Powers of Two
Three heaps contain 14, 20 and 29 stones. Two players alternate; a move picks one heap and removes exactly 2^j stones from it for some j ≥ 0 (1, 2, 4, 8, ...), as long as the heap holds at least that many. A player who cannot move loses. Two moves are different if they use different heaps or remove different amounts. How many first moves leave the opponent in a losing position? Give an integer.
Related problems & prerequisites
Worth solving first
- Nim Where You May Split a Pile 7.0/10
- Counting the Winning Nim Moves 7.0/10
- A Garden of Hackenbush Stalks 7.0/10
Source: Original problem written for AxiomIQ.