# If $\gcd(a,b)=1$, is $\gcd(a^x-b^x,a^y-b^y)=a^{\gcd(x,y)}-b^{\gcd(x,y)}$?

If $\gcd(a,b)=1$, is it true that
$$\gcd(a^x-b^x,a^y-b^y)=a^{\gcd(x,y)}-b^{\gcd(x,y)}\;?$$

I know that $a^{\gcd(x,y)}-b^{\gcd(x,y)}\mid a^x-b^x$ and $a^{\gcd(x,y)}-b^{\gcd(x,y)}|a^y-b^y$, so I thought of something like let $n$ be a divisor of $a^x-b^x$ and $a^y-b^y$, then $n$ must also be a divisor of $a^{\gcd(x,y)}-b^{\gcd(x,y)}$ but I am stuck.

#### Solutions Collecting From Web of "If $\gcd(a,b)=1$, is $\gcd(a^x-b^x,a^y-b^y)=a^{\gcd(x,y)}-b^{\gcd(x,y)}$?"

$\ (a,b)=1\Rightarrow (b,a^n\!-b^n) = (b,a^n) = 1$ so $\,\color{#c00}{b\ {\rm is\ coprime}}$ to $\,a^x\!-b^x,\,a^y\!-b^y\,$ so coprime to any common divisor $\,d.\,$ So $\,{\rm mod}\ d\!:\, c = a/b = a\color{#c00}{b^{-1}\rm\ exists}$, so $\,a^n\equiv b^n\!\!\iff\! c^n =(a/b)^n\!\equiv 1\,$ so

$$c^x\equiv 1\equiv c^y\iff {\rm ord}\, c\mid x,y\iff {\rm ord}\, c\mid(x,y)=:g\iff c^g\equiv 1\quad {\bf QED}$$

To prove:
if $a^x \equiv b^x$ mod $n$ and $a^y \equiv b^y$ mod $n$, then
$a^{gcd(x,y)} \equiv b^{gcd(x,y)}$ mod $n$.

($\gcd(a,b)=1$)

Let $d=\gcd(x,y)$, $x=p*d$, $y=q*d$, then $\gcd(p,q)=1$ so there exists $m,o > 0$ so that $po=1+qm$ or vice versa.
Let $y>x$.

$(a^d)^{po} \equiv (b^d)^{po}$ mod $n$, so
$(a^d)^{1+qm} \equiv (b^d)^{1+qm}$ mod $n$, so
$a^d*(a^{dq})^m \equiv b^d*(b^{dq})^m$ mod $n$
so $a^d \equiv b^d$ mod $n$,
so every $n$ that divides both $a^x-b^x$ and $a^y-b^y$ also divides $a^d-b^d$, so $\gcd(a^x-b^x,a^y-b^y)=a^{\gcd(x,y)}-b^{\gcd(x,y)}$