Let $p$ be a prime number. Troy and Abed are playing a game. Troy writes a positive integer $X$ on the board, and gives a sequence $(a_n)_{n\in\mathbb{N}}$ of positive integers to Abed. Abed now makes a sequence of moves. The $n$-th move is the following: $$\text{ Replace } Y \text{ currently written on the board with either } Y + a_n \text{ or } Y \cdot a_n.$$Abed wins if at some point the number on the board is a multiple of $p$. Determine whether Abed can win, regardless of Troy’s choices, if $a) p = 10^9 + 7$; $b) p = 10^9 + 9$. Remark: Both $10^9 + 7$ and $10^9 + 9$ are prime. Proposed by Ivan Novak
Problem
Source: 9th EMC, 12th December 2020 - 20th December 2020. SENIOR league, P3.
Tags: number theory, game, prime numbers
23.12.2020 01:28
Fun problem to work on ! Part a : The key observation is that $p=2 \pmod 3$. We claim that Troy can chose his sequence such that the number $y$ is always incongruent to $0,1$ mod $p$. Hence Alice can never win. Proceed by induction on the number of indices of the sequence. Its obvious that the claim holds for the base cases.Suppose after $k$ steps we have the number $y$ written on the blackboard. Working in $\mathbb F_p$, let $n=\tfrac {y}{y-1}$ be a solution to $y+n=ny$, we claim that $yn \not \equiv 0,1 \pmod p$. Then Troy can just choose $n$ as $a_{k+1}$ and win. Note that $$yn=1 \pmod p \implies \frac {y^2}{y-1} = 1 \pmod p$$$$ \iff y^2-y+1=0 \pmod p \implies y^3=1 \pmod p \stackrel {\text {orders}}{\implies} y =1 \pmod p (\rightarrow \leftarrow)$$ Hence we are done. $\square$ Part b : The key observation is that $p\equiv 1 \pmod 4$. Let $x=\tfrac {1+i}2$ be a solution to $2x^2-2x+1=0$ in $\mathbb F_p$ where $i^2=-1$. Note that $x\neq 1 \pmod p$. We claim that Troy wins again. Troy chooses $X=x$, $a_1=\tfrac {x}{x-1} $ and $a_2= \tfrac { \tfrac {x^2}{x-1} } { \tfrac {x^2}{x-1} -1 }$, we claim that the number obtained after 2 operations of Alice is the same as $x \pmod p$. To note this, we see that the second and third numbers on the blackboard after Alice's moves are $a=\tfrac {x^2}{x-1}$ and $b=\tfrac {x^4}{(x^2-x+1)(x-1)}$ respectively. We only need to check that $a\neq 1$ and $b=x$ mod p. Work in $\mathbb F_p$ henceforth. $$ \frac {x^2}{x-1} = 1 \iff x^2-x+1 =0 $$$$\iff 2x^2-2x+2=0 \iff 1=0 (\text {oops})$$ $$ \frac {x^4}{(x^2-x+1)(x-1)}= x \iff 2x^2-2x+1=0$$ Where we have used the definition of $x$. We are done. $\square$
13.01.2021 04:21
A playful (literally) problem to spend hours on. Play and experiment to win! Solution almost equal to above, so only a sketch: $\color{magenta} \rule{25cm}{3pt}$ $\color{magenta} \textbf{\text{Part a, Troy wins.}}$ Unironically hard (if you found part b first). Denote the set $Y_i$ to be the set of possible residue classes after operating for $X$ with $a_1, a_2,\ldots, a_i$. Troy are to construct a sequence with arbitrary $X \ne 0,1 \pmod p$, and \[ a_{i+1} \equiv \dfrac{a_i}{a_i-1} \pmod p, \, i \geq 0 \]with setting beforehand $a_0 = X$. This will yield $|Y_i| = 1$ with no repercussions since $a_{i+1} \ne 0$ for obvious reasons, and $a_{i+1} \ne 1$ since \[ \dfrac{{a_i}^2}{a_i-1} \equiv 1 \pmod p \Rightarrow a_i^2-a_i+1 \equiv 0 \pmod p \]which is impossible since $10^9+7 \equiv 2 \pmod 3$. So the sequence will keep going, since if $a_i \ne 0,1 \pmod p$, an $a_{i+1}$ is formable. $\color{green} \rule{25cm}{1.5pt}$ $\color{green} \textbf{\text{Part b, Troy also wins.}}$ This time $X$ won't be arbitrary, and there will be a clear pattern among the member (yes, singular) of $Y_i$; namely, the members will be 2-periodic. Let us wish to construct $x$ and $y$ so that $x \rightarrow y$ and $y \rightarrow x$. A very loose notation: $A \rightarrow B$ means if $A$ is on the board, $A+a_n = A \cdot a_n \equiv B \pmod p$. So, the term which transforms $x$ to $y$ should be $y-x$, and $y$ to $x$ be $x-y$. This means that \[ x(y-x) \equiv y \pmod p, \ y(x-y) \equiv x \pmod p \]Substracting the two equations and factoring out $x-y$, we get $x+y = 1$. Substituting $y = 1-x$, the equation(s) will now be \[ x(1-2x) \equiv 1-x \pmod p \Rightarrow (2x-1)^2+1 \equiv 0 \pmod p \]This is possible since $10^9 + 9 \equiv 1 \pmod 4$. $\blacksquare$ $\blacksquare$ $\blacksquare$