MathLabs

Problem 2

For which pairs of positive integers (a,b)(a,b) is the sequence gcd⁡(an+b,bn+a)\gcd(a^n+b,b^n+a), n=1,2,…n=1,2,\ldots, eventually constant?
Step 2 of 5: Set up the key modulus
In plain words

The number ab+1ab+1 is designed so that aa and 1/a1/a are close to −b-b and −1/b-1/b respectively modulo MM, which will let Euler's theorem interact nicely with the sequence once nn is a suitable multiple of the totient of MM.

M=ab+1,gcd⁡(a,M)=gcd⁡(b,M)=1M=ab+1,\quad \gcd(a,M)=\gcd(b,M)=1
Detailed analysis

Suppose xn:=gcd⁡(an+b,bn+a)x_n:=\gcd(a^n+b,b^n+a) is eventually constant, and set M=ab+1M=ab+1. Since a∣M−1a\mid M-1, gcd⁡(a,M)=1\gcd(a,M)=1, and likewise gcd⁡(b,M)=1\gcd(b,M)=1. Choose nn to be a sufficiently large multiple of φ(M)\varphi(M) so that xn−1=xn=xn+1x_{n-1}=x_n=x_{n+1}.