Problem

Source: Serbia & Montenegro 2001 1st Grade P4

Tags: combinatorics, game



There are $n$ coins in the pile. Two players play a game by alternately performing a move. A move consists of taking $5,7$ or $11$ coins away from the pile. The player unable to perform a move loses the game. Which player - the one playing first or second - has the winning strategy if: (a) $n=2001$; (b) $n=5000$?