Example 9 (2005 National Training Team Test Question) Find all positive integer triples $(a, m, n)$, satisfying: $a>1, m<n$, and the set of prime factors of $a^{m}-1$ is the same as the set of prime factors of $a^{n}-1$.


Let $S(n)$ be the set of distinct prime factors of the positive integer $n$. First, we prove a lemma.

Lemma: If the positive integer $b>1, p$ is a prime, and $S\left(b^{p}-1\right)=S(b-1)$, then $p=2, b+1$ is a power of 2.

Proof of the lemma: Assume $p$ is an odd prime. Since
$$
b^{p-1}+b^{p-2}+\cdots+b+1=\left(b^{p-1}-1\right)+\cdots+(b-1)+p .
$$

If $p \nmid b-1$, then $\left(b^{p-1}+b^{p-2}+\cdots+b+1, b-1\right)=(p, b-1)=1$, thus
$S\left(b^{p-1}+\cdots+b+1\right) \nsubseteq S(b-1)$, contradiction!
If $p \mid b-1$, let $b-1=p^{s} \cdot t, s, t \in \mathbf{Z}^{+}, p \nmid t$, then
$$
\begin{aligned}
b^{p}-1 & =\left(1+p^{s} \cdot t\right)^{p}-1=p \cdot p^{s} \cdot t+C_{p}^{2} \cdot\left(p^{s} \cdot t\right)^{2}+\cdots \\
& =p^{s+1} \cdot t\left(1+p^{s} \cdot t \cdot x\right), x \in \mathbf{Z}^{+} .
\end{aligned}
$$

Since $\left(1+p^{s} \cdot t \cdot x, b-1\right)=\left(1+p^{s} \cdot t \cdot s, p^{s} \cdot t\right)=1$, thus $S\left(b^{p}-1\right) \nsubseteq S(b-1)$, contradiction!
Therefore, $p=2, b^{2}-1=(b-1)(b+1)$.
If $b$ is even, then $(b-1, b+1)=1$, hence $S(b+1) \nsubseteq S(b-1)$, contradiction!
Therefore, $b$ is odd, $b^{2}-1=4 \cdot \frac{b-1}{2} \cdot \frac{b+1}{2}$.
Since $\left(\frac{b-1}{2}, \frac{b+1}{2}\right)=1$, thus $\frac{b+1}{2}$ has no odd prime factors [otherwise $S(b+1) \nsubseteq S(b-1)$, contradiction], i.e., $b+1$ is a power of 2.
Returning to the original problem: Let $(m, n)=d$, we can set $n=k d$, by $m1$. It is well-known that $\left(a^{m}-1, a^{n}-1\right)=a^{(m, n)}-1=a^{d}-1$,
thus we have
$$
S\left(a^{m}-1\right)=S\left(a^{n}-1\right)=S\left(\left(a^{m}-1, a^{n}-1\right)\right)=S\left(a^{d}-1\right) \text {. }
$$

Let $b=a^{d}$, then $b>1$, and $S(b-1)=S\left(b^{k}-1\right)$.
Take any prime factor $p$ of $k$, then
$$
b-1\left|b^{p}-1, b^{p}-1\right| b^{k}-1 \text {, }
$$

thus $S\left(b^{p}-1\right)=S(b-1)$.
By the lemma, $p=2, a^{d}+1=b+1$ is a power of 2. By the arbitrariness of $p$, we have $k=2^{r}, r \in \mathbf{Z}^{+}$. If $r \geqslant 2$, then $S(b-1)=S\left(b^{2}-1\right)=S\left(b^{4}-1\right)=S\left(b^{2}-1\right)$.
Still by the lemma, $b^{2}+1$ is a power of 2, but $b^{2}+1 \equiv 2(\bmod 4), b^{2}+1>2$. Contradiction!
Therefore, $r=1, k=2$.
Let $a^{d}+1=2^{l}, l \in \mathbf{Z}^{+}, l \geqslant 2$, then $a$ is odd.
If $d$ is even, then $a^{d}+1 \equiv 2(\bmod 4)$, which is impossible, hence $d$ is odd.
If $d>1$, since $\frac{a^{d}+1}{a+1}=a^{d-1}-a^{d-2}+\cdots+1$ is an odd number greater than 1, this contradicts $a^{d}+1=2^{t}$!
Therefore, $d=1, n=k d=2$, by $m<n$ we have: $m=1, a=2^{l}-1$.
216
Conversely, when $a=2^{l}-1(l \geqslant 2), m=1, n=2$,
since $a^{2}-1=(a-1)(a+1)=2^{l} \cdot(a-1)$, we know
$S\left(a^{2}-1\right)=S(a-1)$.
In summary, the required $(a, m, n)=\left(2^{l}-1,1,2\right), l \in \mathbf{Z}^{+}, l \geqslant 2$.