0:00
Game Theory 8.0/10

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

Source: Original problem written for AxiomIQ.