Maths Olympiad Prep

Library / IMO Shortlist /182 of 365

IMO Shortlist

Number theory Difficulty 8.6 Shortlist Prove it IMO

Determine all positive integers aa and bb such that there exists a positive integer gg such that gcd⁡(an+b,bn+a)=g\operatorname{gcd}\left(a^{n}+b, b^{n}+a\right)=g for all sufficiently large nn.

(Indonesia)

Solutions — 2

Solution 1

It is clear that we may take g=2g=2 for (a,b)=(1,1)(a, b)=(1,1). Supposing that (a,b)(a, b) satisfies the conditions in the problem, let NN be a positive integer such that gcd⁡(an+b,bn+a)=g\operatorname{gcd}\left(a^{n}+b, b^{n}+a\right)=g for all n⩾Nn \geqslant N.

Lemma. We have that g=gcd⁡(a,b)g=\operatorname{gcd}(a, b) or g=2gcd⁡(a,b)g=2 \operatorname{gcd}(a, b).

Proof. Note that both aN+ba^{N}+b and aN+1+ba^{N+1}+b are divisible by gg. Hence
a(aN+b)−(aN+1+b)=ab−b=a(b−1) a\left(a^{N}+b\right)-\left(a^{N+1}+b\right)=a b-b=a(b-1)
is divisible by gg. Analogously, b(a−1)b(a-1) is divisible by gg. Their difference a−ba-b is then divisible by gg, so gg also divides a(b−1)+a(a−b)=a2−aa(b-1)+a(a-b)=a^{2}-a. All powers of aa are then congruent modulo gg, so a+b≡aN+b≡0( mod g)a+b \equiv a^{N}+b \equiv 0(\bmod g). Then 2a=(a+b)+(a−b)2 a=(a+b)+(a-b) and 2b=(a+b)−(a−b)2 b=(a+b)-(a-b) are both divisible by gg, so g∣2gcd⁡(a,b)g \mid 2 \operatorname{gcd}(a, b). On the other hand, it is clear that gcd⁡(a,b)∣g\operatorname{gcd}(a, b) \mid g, thus proving the Lemma.

Let d=gcd⁡(a,b)d=\operatorname{gcd}(a, b), and write a=dxa=d x and b=dyb=d y for coprime positive integers xx and yy. We have that
gcd⁡((dx)n+dy,(dy)n+dx)=dgcd⁡(dn−1xn+y,dn−1yn+x), \operatorname{gcd}\left((d x)^{n}+d y,(d y)^{n}+d x\right)=d \operatorname{gcd}\left(d^{n-1} x^{n}+y, d^{n-1} y^{n}+x\right),
so the Lemma tells us that
gcd⁡(dn−1xn+y,dn−1yn+x)⩽2 \operatorname{gcd}\left(d^{n-1} x^{n}+y, d^{n-1} y^{n}+x\right) \leqslant 2
for all n⩾Nn \geqslant N. Defining K=d2xy+1K=d^{2} x y+1, note that KK is coprime to each of d,xd, x, and yy. By Euler's theorem, for n≡−1( mod φ(K))n \equiv-1(\bmod \varphi(K)) we have that
dn−1xn+y≡d−2x−1+y≡d−2x−1(1+d2xy)≡0( mod K), d^{n-1} x^{n}+y \equiv d^{-2} x^{-1}+y \equiv d^{-2} x^{-1}\left(1+d^{2} x y\right) \equiv 0 \quad(\bmod K),
so K∣dn−1xn+yK \mid d^{n-1} x^{n}+y. Analogously, we have that K∣dn−1yn+xK \mid d^{n-1} y^{n}+x. Taking such an nn which also satisfies n⩾Nn \geqslant N gives us that
K∣gcd⁡(dn−1xn+y,dn−1yn+x)⩽2 K \mid \operatorname{gcd}\left(d^{n-1} x^{n}+y, d^{n-1} y^{n}+x\right) \leqslant 2
This is only possible when d=x=y=1d=x=y=1, which yields the only solution (a,b)=(1,1)(a, b)=(1,1).

For any prime factor pp of ab+1,pa b+1, p is coprime to aa and bb. Take an n⩾Nn \geqslant N such that n≡−1( mod p−1)n \equiv-1 (\bmod p-1). By Fermat's little theorem, we have that
an+b≡a−1+b=a−1(1+ab)≡0( mod p),bn+a≡b−1+a=b−1(1+ab)≡0( mod p), \begin{aligned} & a^{n}+b \equiv a^{-1}+b=a^{-1}(1+a b) \equiv 0 \quad(\bmod p), \\ & b^{n}+a \equiv b^{-1}+a=b^{-1}(1+a b) \equiv 0 \quad(\bmod p), \end{aligned}
then pp divides gg. By the Lemma, we have that p∣2gcd⁡(a,b)p \mid 2 \operatorname{gcd}(a, b), and thus p=2p=2. Therefore, ab+1a b+1 is a power of 2, and aa and bb are both odd numbers.

If (a,b)≠(1,1)(a, b) \neq(1,1), then ab+1a b+1 is divisible by 4, hence {a,b}={−1,1}( mod 4)\{a, b\}=\{-1,1\}(\bmod 4). For odd n⩾Nn \geqslant N, we have that
an+b≡bn+a≡(−1)+1=0( mod 4) a^{n}+b \equiv b^{n}+a \equiv(-1)+1=0 \quad(\bmod 4)
then 4∣g4 \mid g. But by the Lemma, we have that ν2(g)⩽ν2(2gcd⁡(a,b))=1\nu_{2}(g) \leqslant \nu_{2}(2 \operatorname{gcd}(a, b))=1, which is a contradiction. So the only solution to the problem is (a,b)=(1,1)(a, b)=(1,1).

Solution 2

After proving the Lemma, one can finish the solution as follows.

For any prime factor pp of ab+1,pa b+1, p is coprime to aa and bb. Take an n⩾Nn \geqslant N such that n≡−1( mod p−1)n \equiv-1 (\bmod p-1). By Fermat's little theorem, we have that
an+b≡a−1+b=a−1(1+ab)≡0( mod p),bn+a≡b−1+a=b−1(1+ab)≡0( mod p), \begin{aligned} & a^{n}+b \equiv a^{-1}+b=a^{-1}(1+a b) \equiv 0 \quad(\bmod p), \\ & b^{n}+a \equiv b^{-1}+a=b^{-1}(1+a b) \equiv 0 \quad(\bmod p), \end{aligned}
then pp divides gg. By the Lemma, we have that p∣2gcd⁡(a,b)p \mid 2 \operatorname{gcd}(a, b), and thus p=2p=2. Therefore, ab+1a b+1 is a power of 2, and aa and bb are both odd numbers.

If (a,b)≠(1,1)(a, b) \neq(1,1), then ab+1a b+1 is divisible by 4, hence {a,b}={−1,1}( mod 4)\{a, b\}=\{-1,1\}(\bmod 4). For odd n⩾Nn \geqslant N, we have that
an+b≡bn+a≡(−1)+1=0( mod 4) a^{n}+b \equiv b^{n}+a \equiv(-1)+1=0 \quad(\bmod 4)
then 4∣g4 \mid g. But by the Lemma, we have that ν2(g)⩽ν2(2gcd⁡(a,b))=1\nu_{2}(g) \leqslant \nu_{2}(2 \operatorname{gcd}(a, b))=1, which is a contradiction. So the only solution to the problem is (a,b)=(1,1)(a, b)=(1,1).

Want a route through all this instead of an archive? The track puts 2,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.