From Prove that $\gcd(a^n - 1, a^m - 1) = a^{\gcd(n, m)} - 1$ , we have $$\gcd(a^n-1,a^m-1)=a^{\gcd(n,m)}-1$$ for every positive integers $a,n,m$.
I reversed $a$ with $n,m$, and I had this question:
Find $\gcd(n^a-1,m^a-1)$ for every positive integers $a,n,m$
My attempt is to find the greatest common divisor of $n^p-1$ and $m^p-1$ for every prime $p$ such that $p|a$, but I couldn't get any further.
How can I find the general formula of $\gcd(n^a-1,m^a-1)$ ?
(sorry for my grammar mistake, English is my second language)