PROJECT EULER · #0888
1249 Nim
Two players play a game with a number of piles of stones, alternating turns. Each turn a player can choose to remove 1, 2, 4, or 9 stones from a single pile; or alternatively they can choose to split a pile containing two or more stones into two non-empty piles. The winner is the player who removes the last stone.
A collection of piles is called a losing position if the player to move cannot force a win with optimal play. Define
You are given
Find
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.