Let $f(n) = 1 + a + a^2 + \dots + a^{n-1}$
We are required to prove $\gcd(f(n), f(m)) = f(\gcd(m, n))$.
Proceed by induction on $n$. The base $n = 1$ is trivial. Assume inductively that for some $k$, the above statement holds true for all integers from $1$ to $k$.
Now, we are required to prove that $\gcd(f(k+1), f(m)) = f(\gcd(k + 1, m))$.
If $n > k + 1$, then by the Euclidean Algorithm, $\gcd(f(k+1), f(m)) = \gcd(f(k+1), f(m - k - 1)) = \gcd(f(k + 1), f(m - 2(k+1)))$ and so on until $k + 1 > m - l(k+1)$.
If $m - l(k + 1) < k + 1$, then by the inductive hypothesis $\gcd(f(k + 1), f(m - l(k + 1))) = f(\gcd(k+1, m-l(k+1)))$, by the inductive hypothesis. We can apply the Euclidean Algorithm to this in reverse to get $\gcd(f(k+1), f(n)) = f(\gcd(k+1, n))$ as desired.
If $n < k + 1$, we can apply the inductive hypothesis directly. The case where $n =k$ is trivial.
First off, this proof seems too good to be true. Secondly, it's very inelegant. Is there a more concise proof?
Is this proof correct? Or is there a mistake somewhere?