Maths Olympiad Prep

Track / Stage 6 / 321 of 400 #1801 of 2444

Problem 1801

National Olympiad, first round
Algebra Difficulty 6.6 Prove it Taiwan IMO Selection Camp · Taiwan · 2023

Let a>1a > 1 be a positive integer, and let d>1d > 1 be a positive integer coprime to aa. Let x1=1x_1 = 1 and, for all k1k \ge 1, recursively define
xk+1={xk+dif a doesn’t divide xk,xk/aif a divides xk. x_{k+1} = \begin{cases} x_k + d & \text{if } a \text{ doesn't divide } x_k, \\ x_k/a & \text{if } a \text{ divides } x_k. \end{cases}

Find the greatest positive integer nn (as a function of aa and dd) for which there exists an index kk such that xkx_k is divisible by ana^n.

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

n=max{m:am<ad}n = \max\{m: am < ad\}; note that this means an+1>adan>da^{n+1} > ad \Rightarrow a^n > d.

**Solution 1. By induction, xkx_k is coprime to dd.** Moreover, note that xkx_k can increase for at most a1a-1 consecutive terms, so by induction
{xk<daif xk=xk1+d,xk<dif xk=xk1/a or k=1.(1) \begin{cases} x_k < da & \text{if } x_k = x_{k-1} + d, \\ x_k < d & \text{if } x_k = x_{k-1}/a \text{ or } k = 1. \end{cases} \quad (1)
This implies an<daa^n < da. This gives nmax{m:am<ad}n \le \max\{m: am < ad\}.

We now prove that this upper bound indeed satisfies the requirement of the problem. Note that satisfying (1) also means that the sequence xkx_k must eventually be periodic after some term. Let aka^{-k} denote the multiplicative inverse of aka^k modulo dd; then xkx_k must include 1,a1,a2,,ak mod d1, a^{-1}, a^{-2}, \dots, a^k \text{ mod } d, which is equivalent to including 1,a,a2, mod d1, a, a^2, \dots \text{ mod } d. Let xx_\ell be the first term congruent to ana^n; then =1\ell = 1 or x=x1/ax_\ell = x_{\ell-1}/a (otherwise x=x1+dx1anx_\ell = x_{\ell-1} + d \Rightarrow x_{\ell-1} \equiv a^n, a contradiction.) In either case, by (1), we have x<d<an<dax_\ell < d < a^n < da, and hence
x{and,an2d,,an(a1)d}, x_\ell \in \{a^n - d, a^n - 2d, \dots, a^n - (a-1)d\},
and none of the numbers in the set on the right is divisible by aa, so the sequence must reach the value ana^n within a1a-1 terms after xx_\ell.

**Solution 2. As in Solution 1, xkx_k is coprime to dd and xk<adx_k < ad.** Let
S={xZ>0:0<x<ad,gcd(x,d)=1}, S = \{x \in \mathbb{Z}_{>0} : 0 < x < ad, \gcd(x, d) = 1\},
and consider f:SSf: S \to S
f(x)={x+dif ax,x/aif ax. f(x) = \begin{cases} x+d & \text{if } a \nmid x, \\ x/a & \text{if } a \mid x. \end{cases}
Then x1=1x_1 = 1 and xk+1=f(xk)x_{k+1} = f(x_k).

Let us prove that the above recursion is invertible. Suppose that f(x)=yf(x) = y for some pair x,ySx, y \in S:

- If y>dy > d, then necessarily f(x)=x+df(x) = x + d, so yd=xSy - d = x \in S and aySay \notin S;
- If y<dy < d, then necessarily f(x)=x/af(x) = x/a, so ay=xSay = x \in S and ydSy - d \notin S.

This shows that ff is a permutation of SS, with inverse
f1(y)={ydif y>d,a×yif y<d. f^{-1}(y) = \begin{cases} y - d & \text{if } y > d, \\ a \times y & \text{if } y < d. \end{cases}

Now, since ff is a permutation of SS, it must be periodic, so there are infinitely many terms equal to 1. Take \ell sufficiently large so that x=1x_{\ell} = 1; then we have
x=1,x1=f1(x)=a,,xn=an. x_{\ell} = 1, \quad x_{\ell-1} = f^{-1}(x_{\ell}) = a, \dots, \quad x_{\ell-n} = a^n.

Source: MathNet, licensed CC-BY-4.0. Statement translated into English from zh; metadata (topic, difficulty, ordering) added by this project.