For a positive integer $n$, two players A and B play the following game: Given a pile of $s$ stones, the players take turn alternatively with A going first. On each turn the player is allowed to take either one stone, or a prime number of stones, or a multiple of $n$ stones. The winner is the one who takes the last stone. Assuming both $\mathrm{A}$ and $\mathrm{B}$ play perfectly, for how many values of $s$ the player A cannot win?
Denote by $k$ the sought number and let $\left\{s_{1}, \mathrm{~s}_{2}, \ldots, \mathrm{s}_{k}\right\}$ be the corresponding values for $s$. We call each $s_{i}$ a losing number and every other nonnegative integer a winning number.

## Clearly every multiple of $n$ is a winning number.

Suppose there are two different losing numbers $s_{i}>s_{j}$, which are congruent modulo $n$. Then, on his first turn of play, player $A$ may remove $s_{i}-s_{j}$ stones (since $n \mid s_{i}-s_{j}$), leaving a pile with $s_{j}$ stones for B. This is in contradiction with both $s_{i}$ and $s_{j}$ being losing numbers.

Hence, there are at most $n-1$ losing numbers, i.e. $k \leq n-1$.

Suppose there exists an integer $r \in\{1,2, \ldots, n-1\}$, such that $m n+r$ is a winning number for every $m \in \mathbb{N}_{0}$. Let us denote by $u$ the greatest losing number (if $k>0$) or 0 (if $k=0$), and let $s=\operatorname{LCM}(2,3, \ldots, u+n+1)$. Note that all the numbers $s+2, s+3, \ldots, s+u+n+1$ are composite. Let $m^{\prime} \in \mathbb{N}_{0}$, be such that $s+u+2 \leq m^{\prime} n+r \leq s+u+n+1$. In order for $m^{\prime} n+r$ to be a winning number, there must exist an integer $p$, which is either one, or prime, or a positive multiple of $n$, such that $m^{\prime} n+r-p$ is a losing number or 0, and hence lesser than or equal to $u$. Since $s+2 \leq m^{\prime} n+r-u \leq p \leq m^{\prime} n+r \leq s+u+n+1, p$ must be a composite, hence $p$ is a multiple of $n$ (say $p=q n$). But then $m^{\prime} n+r-p=\left(m^{\prime}-q\right) n+r$ must be a winning number, according to our assumption. This contradicts our assumption that all numbers $m n+r, m \in \mathbb{N}_{0}$ are winning.

Hence, each nonzero residue class modulo $n$ contains a losing number.

There are exactly $n-1$ losing numbers.

Lemma: No pair $(u, n)$ of positive integers satisfies the following property:

$(*) \quad$ In $\mathbb{N}$ exists an arithmetic progression $\left(a_{t}\right)_{t=1}^{\infty}$ with difference $n$ such that each segment

$\left[a_{i}-u, a_{i}+u\right]$ contains a prime.

Proof of the lemma: Suppose such a pair $(u, n)$ and a corresponding arithmetic progression $\left(\mathrm{a}_{t}\right)_{t=1}^{\infty}$ exist. In $\mathbb{N}$ exist arbitrarily long patches of consecutive composites. Take such a patch $P$ of length $3 u n$. Then, at least one segment $\left[a_{i}-u, a_{i}+u\right]$ is fully contained in $P$, a contradiction.

Suppose such a nonzero residue class modulo $n$ exists (hence $n>1$). Let $u \in \mathbb{N}$ be greater than every losing number. Consider the members of the supposed residue class which are greater than $u$. They form an arithmetic progression with the property $\left({ }^{*}\right)$, a contradiction (by the lemma).