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 3 of 5: The modulus divides one term exactly
In plain words

Multiplying an−1+ba^{n-1}+b by aa produces ana^n plus abab, and Euler's theorem makes ana^n congruent to 11 modulo MM, so this product is a multiple of MM; the same works for the other side, forcing MM to divide their gcd.

M∣xn−1M\mid x_{n-1}
Detailed analysis

Since n≡0(modφ(M))n\equiv0\pmod{\varphi(M)} and gcd⁡(a,M)=1\gcd(a,M)=1, Euler's theorem gives an≡1(modM)a^n\equiv1\pmod M. Then a(an−1+b)=an+ab≡1+(M−1)=M≡0(modM)a(a^{n-1}+b)=a^n+ab\equiv1+(M-1)=M\equiv0\pmod M, and since gcd⁡(a,M)=1\gcd(a,M)=1 this gives M∣an−1+bM\mid a^{n-1}+b. Symmetrically bn≡1(modM)b^n\equiv1\pmod M gives b(bn−1+a)=bn+ab≡0(modM)b(b^{n-1}+a)=b^n+ab\equiv0\pmod M, so M∣bn−1+aM\mid b^{n-1}+a. Hence M∣gcd⁡(an−1+b,bn−1+a)=xn−1M\mid\gcd(a^{n-1}+b,b^{n-1}+a)=x_{n-1}.