Maths Olympiad Prep

Library / /6 of 15

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 nNn \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)=abb=a(b1) a\left(a^{N}+b\right)-\left(a^{N+1}+b\right)=a b-b=a(b-1)
is divisible by gg. Analogously, b(a1)b(a-1) is divisible by gg. Their difference aba-b is then divisible by gg, so gg also divides a(b1)+a(ab)=a2aa(b-1)+a(a-b)=a^{2}-a. All powers of aa are then congruent modulo gg, so a+baN+b0(modg)a+b \equiv a^{N}+b \equiv 0(\bmod g). Then 2a=(a+b)+(ab)2 a=(a+b)+(a-b) and 2b=(a+b)(ab)2 b=(a+b)-(a-b) are both divisible by gg, so g2gcd(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(dn1xn+y,dn1yn+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(dn1xn+y,dn1yn+x)2 \operatorname{gcd}\left(d^{n-1} x^{n}+y, d^{n-1} y^{n}+x\right) \leqslant 2
for all nNn \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 n1(modφ(K))n \equiv-1(\bmod \varphi(K)) we have that
dn1xn+yd2x1+yd2x1(1+d2xy)0(modK), 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 Kdn1xn+yK \mid d^{n-1} x^{n}+y. Analogously, we have that Kdn1yn+xK \mid d^{n-1} y^{n}+x. Taking such an nn which also satisfies nNn \geqslant N gives us that
Kgcd(dn1xn+y,dn1yn+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 nNn \geqslant N such that n1(modp1)n \equiv-1 (\bmod p-1). By Fermat's little theorem, we have that
an+ba1+b=a1(1+ab)0(modp),bn+ab1+a=b1(1+ab)0(modp), \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 p2gcd(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}(mod4)\{a, b\}=\{-1,1\}(\bmod 4). For odd nNn \geqslant N, we have that
an+bbn+a(1)+1=0(mod4) a^{n}+b \equiv b^{n}+a \equiv(-1)+1=0 \quad(\bmod 4)
then 4g4 \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 nNn \geqslant N such that n1(modp1)n \equiv-1 (\bmod p-1). By Fermat's little theorem, we have that
an+ba1+b=a1(1+ab)0(modp),bn+ab1+a=b1(1+ab)0(modp), \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 p2gcd(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}(mod4)\{a, b\}=\{-1,1\}(\bmod 4). For odd nNn \geqslant N, we have that
an+bbn+a(1)+1=0(mod4) a^{n}+b \equiv b^{n}+a \equiv(-1)+1=0 \quad(\bmod 4)
then 4g4 \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,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic and difficulty added by this site.