# Generalisation of $\gcd\left(\frac{a^n-b^n}{a-b},a-b\right)=\gcd(n\gcd(a,b)^{n-1},a-b)$ to $\gcd\left(\frac{a^n-b^n}{a-b},a^m-b^m\right)$?

We have the identity $$\gcd\left(\frac{a^n-b^n}{a-b},a-b\right)=\gcd(n\gcd(a,b)^{n-1},a-b).$$ (see here)

This appears to be a quite useful result with various applications. I wonder whether there is a similar identity for

$$\gcd\left(\frac{a^n-b^n}{a-b},a^m-b^m\right),$$

preferably telling what this $\gcd$ is in terms of $n,m,a-b$ or $a^{\gcd(m,n)}-b^{\gcd(m,n)}$ or so.

• Chapter 2 of Ribenboim's Fermat's Last Theorem for Amateurs goes through a huge number of identities and theorems related to this, though I can't remember specifically if he touches on the generalization you're after. – Kieren MacMillan Feb 22 '16 at 20:48