Subfield: Number Theory


Question: Fix an integer $k \geqslant 2$. Two players, called Ana and Banana, play the following game of numbers: Initially, some integer $n \geqslant k$ gets written on the blackboard. Then they take moves in turn, with Ana beginning. A player making a move erases the number $m$ just written on the blackboard and replaces it by some number $m^{\prime}$ with $k \leqslant m^{\prime}<m$ that is coprime to $m$. The first player who cannot move anymore loses.

An integer $n \geqslant k$ is called good if Banana has a winning strategy when the initial number is $n$, and bad otherwise.

Consider two integers $n, n^{\prime} \geqslant k$ with the property that each prime number $p \leqslant k$ divides $n$ if and only if it divides $n^{\prime}$. Prove that either both $n$ and $n^{\prime}$ are good or both are bad.

Solution:
Let us first observe that the number appearing on the blackboard decreases after every move; so the game necessarily ends after at most $n$ steps, and consequently there always has to be some player possessing a winning strategy. So if some $n \geqslant k$ is bad, then Ana has a winning strategy in the game with starting number $n$.

More precisely, if $n \geqslant k$ is such that there is a good integer $m$ with $n>m \geqslant k$ and $\operatorname{gcd}(m, n)=1$, then $n$ itself is bad, for Ana has the following winning strategy in the game with initial number $n$ : She proceeds by first playing $m$ and then using Banana's strategy for the game with starting number $m$.

Otherwise, if some integer $n \geqslant k$ has the property that every integer $m$ with $n>m \geqslant k$ and $\operatorname{gcd}(m, n)=1$ is bad, then $n$ is good. Indeed, if Ana can make a first move at all in the game with initial number $n$, then she leaves it in a position where the first player has a winning strategy, so that Banana can defeat her.

In particular, this implies that any two good numbers have a non-trivial common divisor. Also, $k$ itself is good.

For brevity, we say that $n \longrightarrow x$ is a move if $n$ and $x$ are two coprime integers with $n>x \geqslant k$.

Claim 1. If $n$ is good and $n^{\prime}$ is a multiple of $n$, then $n^{\prime}$ is also good.

Proof. If $n^{\prime}$ were bad, there would have to be some move $n^{\prime} \longrightarrow x$, where $x$ is good. As $n^{\prime}$ is a multiple of $n$ this implies that the two good numbers $n$ and $x$ are coprime, which is absurd.

Claim 2. If $r$ and $s$ denote two positive integers for which $r s \geqslant k$ is bad, then $r^{2} s$ is also bad. Proof. Since $r s$ is bad, there is a move $r s \longrightarrow x$ for some good $x$. Evidently $x$ is coprime to $r^{2} s$ as well, and hence the move $r^{2} s \longrightarrow x$ shows that $r^{2} s$ is indeed bad.

Claim 3. If $p>k$ is prime and $n \geqslant k$ is bad, then $n p$ is also bad.

Proof. Otherwise we choose a counterexample with $n$ being as small as possible. In particular, $n p$ is good. Since $n$ is bad, there is a move $n \longrightarrow x$ for some good $x$. Now $n p \longrightarrow x$ cannot be a valid move, which tells us that $x$ has to be divisible by $p$. So we can write $x=p^{r} y$, where $r$ and $y$ denote some positive integers, the latter of which is not divisible by $p$.

Note that $y=1$ is impossible, for then we would have $x=p^{r}$ and the move $x \longrightarrow k$ would establish that $x$ is bad. In view of this, there is a least power $y^{\alpha}$ of $y$ that is at least as large as $k$. Since the numbers $n p$ and $y^{\alpha}$ are coprime and the former is good, the latter has to be bad. Moreover, the minimality of $\alpha$ implies $y^{\alpha}<k y<p y=\frac{x}{p^{r-1}}<\frac{n}{p^{r-1}}$. So $p^{r-1} \cdot y^{\alpha}<n$ and consequently all the numbers $y^{\alpha}, p y^{\alpha}, \ldots, p^{r} \cdot y^{\alpha}=p\left(p^{r-1} \cdot y^{\alpha}\right)$ are bad due to the minimal choice of $n$. But now by Claim 1 the divisor $x$ of $p^{r} \cdot y^{\alpha}$ cannot be good, whereby we have reached a contradiction that proves Claim 3.



We now deduce the statement of the problem from these three claims. To this end, we call two integers $a, b \geqslant k$ similar if they are divisible by the same prime numbers not exceeding $k$. We are to prove that if $a$ and $b$ are similar, then either both of them are good or both are bad. As in this case the product $a b$ is similar to both $a$ and $b$, it suffices to show the following: if $c \geqslant k$ is similar to some of its multiples $d$, then either both $c$ and $d$ are good or both are bad.

Assuming that this is not true in general, we choose a counterexample $\left(c_{0}, d_{0}\right)$ with $d_{0}$ being as small as possible. By Claim 1, $c_{0}$ is bad whilst $d_{0}$ is good. Plainly $d_{0}$ is strictly greater than $c_{0}$ and hence the quotient $\frac{d_{0}}{c_{0}}$ has some prime factor $p$. Clearly $p$ divides $d_{0}$. If $p \leqslant k$, then $p$ divides $c_{0}$ as well due to the similarity, and hence $d_{0}$ is actually divisible by $p^{2}$. So $\frac{d_{0}}{p}$ is good by the contrapositive of Claim 2. Since $c_{0} \mid \frac{d_{0}}{p}$, the pair $\left(c_{0}, \frac{d_{0}}{p}\right)$ contradicts the supposed minimality of $d_{0}$. This proves $p>k$, but now we get the same contradiction using Claim 3 instead of Claim 2. Thereby the problem is solved.
We use the same analysis of the game of numbers as in the first five paragraphs of the first solution. Let us call a prime number $p$ small in case $p \leqslant k$ and big otherwise. We again call two integers similar if their sets of small prime factors coincide.

Claim 4. For each integer $b \geqslant k$ having some small prime factor, there exists an integer $x$ similar to it with $b \geqslant x \geqslant k$ and having no big prime factors.

Proof. Unless $b$ has a big prime factor we may simply choose $x=b$. Now let $p$ and $q$ denote a small and a big prime factor of $b$, respectively. Let $a$ be the product of all small prime factors of $b$. Further define $n$ to be the least non-negative integer for which the number $x=p^{n} a$ is at least as large as $k$. It suffices to show that $b>x$. This is clear in case $n=0$, so let us assume $n>0$ from now on. Then we have $x<p k$ due to the minimality of $n, p \leqslant a$ because $p$ divides $a$ by construction, and $k<q$. Therefore $x<a q$ and, as the right hand side is a product of distinct prime factors of $b$, this implies indeed $x<b$.

Let us now assume that there is a pair $(a, b)$ of similar numbers such that $a$ is bad and $b$ is good. Take such a pair with $\max (a, b)$ being as small as possible. Since $a$ is bad, there exists a move $a \longrightarrow r$ for some good $r$. Since the numbers $k$ and $r$ are both good, they have a common prime factor, which necessarily has to be small. Thus Claim 4 is applicable to $r$, which yields an integer $r^{\prime}$ similar to $r$ containing small prime factors only and satisfying $r \geqslant r^{\prime} \geqslant k$. Since $\max \left(r, r^{\prime}\right)=r<a \leqslant \max (a, b)$ the number $r^{\prime}$ is also good. Now let $p$ denote a common prime factor of the good numbers $r^{\prime}$ and $b$. By our construction of $r^{\prime}$, this prime is small and due to the similarities it consequently divides $a$ and $r$, contrary to $a \longrightarrow r$ being a move. Thereby the problem is solved.