Maths Olympiad Prep

Track / Stage 6 / 204 of 400 #1204 of 1964

Problem 1204

National Olympiad, first round
Number theory Difficulty 6.3 Prove it

Let pp be a prime number. Tristan and Abigaëlle play the following game. Tristan writes an integer X⩾1X \geqslant 1 on the board and gives a sequence (an)n∈N1\left(a_{n}\right)_{n \in \mathbb{N}} 1 of strictly positive integers to Abigaëlle. Abigaëlle then plays an infinite number of turns. During the nth n^{\text {th }} turn,

Abigaëlle replaces, according to her choice, the integer YY written on the board with the integer Y+anY+a_{n} or with the integer Y⋅anY \cdot a_{n}.

Abigaëlle wins if, after a finite number of turns, she manages to write a multiple of pp on the board. Determine if she can succeed in winning regardless of Tristan's initial choices, in each of the following two cases:
a) p=109+7p=10^{9}+7;
b) p=109+9p=10^{9}+9.

Note: It is assumed that 109+710^{9}+7 and 109+910^{9}+9 are prime.

This one wants a proof. Work it on paper, then read the official solution and mark yourself. Be honest about it: the record is only any use to you if it is.

Next problem →

Official solution

Here, Abigail has too many possibilities: each time she can potentially get two different results, so if Tristan has a hope of winning, he would like that at the nn-th turn, Abigail has only one possibility modulo p:bnp: b_{n}. Initially, he chooses X=b0X=b_{0}. Then, from bnb_{n}, to have only one possibility, he would like to choose an+1a_{n+1} such that an+1bn≡an+1+bn( mod p)a_{n+1} b_{n} \equiv a_{n+1}+b_{n}(\bmod p), i.e., an+1≡bn1−bn( mod p)a_{n+1} \equiv \frac{b_{n}}{1-b_{n}}(\bmod p). In particular, we will have bn+1≡bn2bn−1( mod p)b_{n+1} \equiv \frac{b_{n}^{2}}{b_{n}-1}(\bmod p). It is noted that having bn≡1( mod p)b_{n} \equiv 1(\bmod p) is a problem for Tristan.

Thus, let's give the following strategy for Tristan: Tristan chooses an XX that is not congruent to 0 or 1  mod p\bmod p. He sets b0=Xb_{0}=X. Then, as long as bnb_{n} is not 1 modulo pp, he sets an+1≡bnbn−1( mod p)a_{n+1} \equiv \frac{b_{n}}{b_{n}-1}(\bmod p) and bn+1≡bn2bn−1( mod p)b_{n+1} \equiv \frac{b_{n}^{2}}{b_{n}-1}(\bmod p). We can show by immediate induction that Abigail, after nn choices, will have written bn( mod p)b_{n}(\bmod p) on the board.

We can hope that for all n,ann, a_{n} is always defined and bnb_{n} is always different from 0 and 1 modulo pp. Note that if bn≠0,1( mod p),bn+1≠0( mod p)b_{n} \neq 0,1(\bmod p), b_{n+1} \neq 0(\bmod p). Moreover, bn+1≡1( mod p)b_{n+1} \equiv 1(\bmod p) is equivalent to bn2−bn+1≡0( mod p)b_{n}^{2}-b_{n}+1 \equiv 0(\bmod p). This polynomial has a root modulo pp if and only if its discriminant, -3, is a square modulo pp.

By quadratic reciprocity,

(−3p)=(−1p)(3p)=(−1)p−12(−1)2(p−1)4(p3)=(p3) \left(\frac{-3}{p}\right)=\left(\frac{-1}{p}\right)\left(\frac{3}{p}\right)=(-1)^{\frac{p-1}{2}}(-1)^{\frac{2(p-1)}{4}}\left(\frac{p}{3}\right)=\left(\frac{p}{3}\right)

In particular, this gives us the question aa: since p≡2( mod 3),(−3p)=−1p \equiv 2(\bmod 3),\left(\frac{-3}{p}\right)=-1, so the equation x2−x+1≡0( mod p)x^{2}-x+1 \equiv 0(\bmod p) has no solution: thus bn+1b_{n+1} cannot be 1 modulo pp, so Tristan wins.

For question bb, unfortunately, we cannot ensure that the previous process works. One option is that bnb_{n} quickly loops. Since bn+1≡bn+an+1≡bnan+1b_{n+1} \equiv b_{n}+a_{n+1} \equiv b_{n} a_{n+1}, if bn+1≡bn,an+1≡0( mod p)b_{n+1} \equiv b_{n}, a_{n+1} \equiv 0(\bmod p), so bn+1≡0( mod p)b_{n+1} \equiv 0(\bmod p). The best we can hope for is to have a loop of size 2, i.e., b2≡b0( mod p)b_{2} \equiv b_{0}(\bmod p).

Now,

b2≡b12b1−1≡b04(b0−1)2b02b0−1−1 b_{2} \equiv \frac{b_{1}^{2}}{b_{1}-1} \equiv \frac{\frac{b_{0}^{4}}{\left(b_{0}-1\right)^{2}}}{\frac{b_{0}^{2}}{b_{0}-1}-1}

The equation (with x≢0( mod p))x≡x4(x−1)2x2x−1−1x \not \equiv 0(\bmod p)) x \equiv \frac{\frac{x^{4}}{(x-1)^{2}}}{\frac{x^{2}}{x-1}-1} is equivalent to 1≡x3x2(x−1)−(x−1)2≡1 \equiv \frac{x^{3}}{x^{2}(x-1)-(x-1)^{2}} \equiv x3x3−2x2+2x−1\frac{x^{3}}{x^{3}-2 x^{2}+2 x-1}, and thus to 2x2−2x+1≡0( mod p)2 x^{2}-2 x+1 \equiv 0(\bmod p), and this makes sense provided that xx is different from 0 and 1 modulo xx and x2x−1\frac{x^{2}}{x-1} is different from 0 or 1 modulo pp.

The equation 2x2−2x+1≡0( mod p)2 x^{2}-2 x+1 \equiv 0(\bmod p) is a quadratic equation, which has a solution modulo pp if and only if its discriminant, which is -4, is a square modulo pp. -4 is a square if and only if -1 is. In bb, since p≡1( mod 4)p \equiv 1(\bmod 4), -1 is indeed a square: there exists a root modulo pp of 2x2−2x+12 x^{2}-2 x+1, which we will denote by yy. 0 and 1 not being roots, yy is different from 0 or 1. Moreover, we cannot have y2y−1≡0\frac{y^{2}}{y-1} \equiv 0 or 1 modulo pp: for 0, this is clear, for 1, this would imply having y2−y≡1y^{2}-y \equiv 1, so 2y2−2x≡22 y^{2}-2 x \equiv 2. But 2y2−2y≡−12 y^{2}-2 y \equiv-1, and 2≢−1( mod p)2 \not \equiv-1(\bmod p). Thus, if we take X=yX=y, we obtain by immediate induction that bn≡b0b_{n} \equiv b_{0} if nn is even, b1b_{1} if nn is odd, and is different from 0 and 1 for all n⩾0n \geqslant 0. Thus Abigail cannot win: in both cases, Tristan wins.

Source: NuminaMath-1.5, licensed Apache-2.0. Statement reproduced verbatim; metadata (topic, difficulty, ordering) added by this project.