Problem

Source: 2015 CentroAmerican Math Olympiad #4

Tags: OMCC, combinatorics



Anselmo and Bonifacio start a game where they alternatively substitute a number written on a board. In each turn, a player can substitute the written number by either the number of divisors of the written number or by the difference between the written number and the number of divisors it has. Anselmo is the first player to play, and whichever player is the first player to write the number $0$ is the winner. Given that the initial number is $1036$, determine which player has a winning strategy and describe that strategy. Note: For example, the number of divisors of $14$ is $4$, since its divisors are $1$, $2$, $7$, and $14$.