Alice and Bob play the following game...

823 Views Asked by At

They first agree on a positive integer $n>1$,called the target number, which remains fixed. Throughout, the state of the game is represented by an integer, which is initially $1$. Players take turns with Alice going first. Each turn, a player names a prime factor of $n$, and the state of the game is multiplied by this prime. If a player manages to make the state of the game exactly equal to the target number,$n$, then that player wins. If the state of the game ever exceeds $n$, then the game is declared a draw.

Determine for which values of $n$ each player has a winning strategy, and for which values of $n$ the game should end in a draw.

1

There are 1 best solutions below

0
On

For given $n$, only one player might win and the other might lose, since the number of moves up to the win is the fixed number of prime factors of $n$. The potential loser can force a draw if they can make the exponent of any of the prime factors exceed its exponent in $n$.

This is always possible if $n$ has more than two distinct prime factors, since after the exponent for one of them is attained the potential loser has a chance to exceed it before the other two exponents can be attained.

If $n$ has exactly two distinct prime factors, then if their exponents differ by $2$ or more the potential loser can keep playing the one with the lower exponent and exceed it before the higher exponent is attained. However, if the exponents of the two primes are equal or differ only by $1$, the potential winner can force a win: If the exponents are equal, Bob wins by complementing Alice's moves, and if they differ by $1$, Alice wins by equalising the difference in her first move and then complementing Bob's moves.

If $n$ is a prime power, there are no choices and the potential winner wins.

In summary, if $n$ has more than $2$ distinct prime factors or has $2$ distinct prime factors whose exponents differ by at least $2$, the game is a draw; otherwise, Alice wins if $n$ has an odd number of prime factors and Bob wins if $n$ has an even number of prime factors.