Let $a \in \mathbb{N}^{*}, n, m \in \mathbb{N}$. Calculate the GCD of $a^{n}-1$ and $a^{m}-1$.
When writing a step of the Euclidean algorithm, assuming for example $n \geqslant m$, we obtain that:

$\left(a^{n}-1\right) \wedge\left(a^{m}-1\right)=\left(a^{n-m}-1\right) \wedge\left(a^{m}-1\right)$. We are thus in fact applying the Euclidean algorithm to the exponents, and it follows that: $\left(a^{n}-1\right) \wedge\left(a^{m}-1\right)=a^{n \wedge m}-1$.