Ivete B.M.

In a pile of $\$ n \$$ stones, two players take turns. On a turn, a player can take from the pile a number of stones equal to a prime divisor of the current number of stones in the pile, or equal to 1. The player who takes the last stone wins. For which \$n\$ can the starting player always play in such a way as to win, regardless of how the opponent plays?
Strategy: always leave a multiple of 4 stones in the pile: when $\$ n=4 \mathrm{k}+1 \$$ take one stone, when $\$ \mathrm{n}=4 \mathrm{k}+2 \$$ - two stones; when $\$ \mathrm{n}=4 \mathrm{k}+3 \$$ take $\$ \mathrm{p} \$$ stones, where $\$ \mathrm{p} \$$ is a prime divisor of $\$ \mathrm{n} \$$ of the form $\$ 4 q+3 \$$ (such a divisor exists, otherwise all prime divisors of $\$ n \$$ would be of the form $\$ 4 m+1 \$$, and the product of numbers of this form also has this form and is not equal to $\$ 4 \mathrm{k}+3 \$$.

The opponent cannot take a number of stones that is a multiple of 4 from a pile with a multiple of 4 stones (this would not be a prime number), so the first player can continue to play according to the strategy.

## Answer

when $\$ n \$$ is not a multiple of 4.

Send a comment