Maths Olympiad Prep

Track / Stage 6 / 179 of 400 #1179 of 1964

Problem 1179

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 X1X \geqslant 1 on the board and gives a sequence (an)nN1\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 YanY \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.

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+1bnan+1+bn(modp)a_{n+1} b_{n} \equiv a_{n+1}+b_{n}(\bmod p), i.e., an+1bn1bn(modp)a_{n+1} \equiv \frac{b_{n}}{1-b_{n}}(\bmod p). In particular, we will have bn+1bn2bn1(modp)b_{n+1} \equiv \frac{b_{n}^{2}}{b_{n}-1}(\bmod p). It is noted that having bn1(modp)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 modp\bmod p. He sets b0=Xb_{0}=X. Then, as long as bnb_{n} is not 1 modulo pp, he sets an+1bnbn1(modp)a_{n+1} \equiv \frac{b_{n}}{b_{n}-1}(\bmod p) and bn+1bn2bn1(modp)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(modp)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 bn0,1(modp),bn+10(modp)b_{n} \neq 0,1(\bmod p), b_{n+1} \neq 0(\bmod p). Moreover, bn+11(modp)b_{n+1} \equiv 1(\bmod p) is equivalent to bn2bn+10(modp)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)p12(1)2(p1)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 p2(mod3),(3p)=1p \equiv 2(\bmod 3),\left(\frac{-3}{p}\right)=-1, so the equation x2x+10(modp)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+1bn+an+1bnan+1b_{n+1} \equiv b_{n}+a_{n+1} \equiv b_{n} a_{n+1}, if bn+1bn,an+10(modp)b_{n+1} \equiv b_{n}, a_{n+1} \equiv 0(\bmod p), so bn+10(modp)b_{n+1} \equiv 0(\bmod p). The best we can hope for is to have a loop of size 2, i.e., b2b0(modp)b_{2} \equiv b_{0}(\bmod p).

Now,

b2b12b11b04(b01)2b02b011 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(modp))xx4(x1)2x2x11x \not \equiv 0(\bmod p)) x \equiv \frac{\frac{x^{4}}{(x-1)^{2}}}{\frac{x^{2}}{x-1}-1} is equivalent to 1x3x2(x1)(x1)21 \equiv \frac{x^{3}}{x^{2}(x-1)-(x-1)^{2}} \equiv x3x32x2+2x1\frac{x^{3}}{x^{3}-2 x^{2}+2 x-1}, and thus to 2x22x+10(modp)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 x2x1\frac{x^{2}}{x-1} is different from 0 or 1 modulo pp.

The equation 2x22x+10(modp)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 p1(mod4)p \equiv 1(\bmod 4), -1 is indeed a square: there exists a root modulo pp of 2x22x+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 y2y10\frac{y^{2}}{y-1} \equiv 0 or 1 modulo pp: for 0, this is clear, for 1, this would imply having y2y1y^{2}-y \equiv 1, so 2y22x22 y^{2}-2 x \equiv 2. But 2y22y12 y^{2}-2 y \equiv-1, and 2≢1(modp)2 \not \equiv-1(\bmod p). Thus, if we take X=yX=y, we obtain by immediate induction that bnb0b_{n} \equiv b_{0} if nn is even, b1b_{1} if nn is odd, and is different from 0 and 1 for all n0n \geqslant 0. Thus Abigail cannot win: in both cases, Tristan wins.

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.