Maths Olympiad Prep

Track / Stage 6 / 321 of 400 #1961 of 2604

Problem 1961

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 k≥1k \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>ad⇒an>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 a−1a-1 consecutive terms, so by induction
{xk<daif xk=xk−1+d,xk<dif xk=xk−1/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 n≤max⁡{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 a−ka^{-k} denote the multiplicative inverse of aka^k modulo dd; then xkx_k must include 1,a−1,a−2,…,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 xℓx_\ell be the first term congruent to ana^n; then ℓ=1\ell = 1 or xℓ=xℓ−1/ax_\ell = x_{\ell-1}/a (otherwise xℓ=xℓ−1+d⇒xℓ−1≡anx_\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ℓ∈{an−d,an−2d,…,an−(a−1)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 a−1a-1 terms after xℓx_\ell.

**Solution 2. As in Solution 1, xkx_k is coprime to dd and xk<adx_k < ad.** Let
S={x∈Z>0:0<x<ad,gcd⁡(x,d)=1}, S = \{x \in \mathbb{Z}_{>0} : 0 < x < ad, \gcd(x, d) = 1\},
and consider f:S→Sf: S \to S
f(x)={x+dif a∤x,x/aif a∣x. 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,y∈Sx, y \in S:

- If y>dy > d, then necessarily f(x)=x+df(x) = x + d, so y−d=x∈Sy - d = x \in S and ay∉Say \notin S;
- If y<dy < d, then necessarily f(x)=x/af(x) = x/a, so ay=x∈Say = x \in S and y−d∉Sy - d \notin S.

This shows that ff is a permutation of SS, with inverse
f−1(y)={y−dif 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,xℓ−1=f−1(xℓ)=a,…,xℓ−n=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.