Example 24 (Mathematical Problem 1493 from "Mathematical Bulletin") Let $m, n \in \mathbf{N}^{+}, (m, n)=1, p, q$ be two distinct odd positive primes. Find the greatest common divisor $\left(p^{m}+q^{m}, p^{n}+q^{n}\right)$ of $\left(p^{m}+q^{n}\right)$ and $\left(p^{n}+q^{n}\right)$.
Let $I(m, n)=\left(p^{m}+q^{m}, p^{n}+q^{n}\right)$, then we have
$$
\begin{aligned}
& I(0,1)=(2, p+q)=2, \\
& I(1,1)=(p+q, p+q)=p+q .
\end{aligned}
$$

Since $I(m, n)=I(n, m)$, without loss of generality, we can assume $n \geqslant m$. When $n \geqslant 2 m$,
$$
\begin{aligned}
& \left(p^{m}+q^{m}, p^{n}+q^{n}\right) \\
= & \left(p^{m}+q^{m},\left(p^{m}+q^{m}\right)\left(p^{n-m}+q^{n-m}\right)-p^{m} q^{n-m}-p^{n-m} \cdot q^{m}\right) \\
= & \left(p^{m}+q^{m},\left(p^{m}+q^{m}\right)\left(p^{n-m}+q^{n-m}\right)-p^{m} q^{m}\left(q^{n-2 m}+p^{n-2 m}\right)\right) \\
= & \left(p^{m}+q^{m}, p^{m} q^{m}\left(q^{n-2 m}+p^{n-2 m}\right)\right) \\
= & \left(p^{m}+q^{m}, p^{n-2 m}+q^{n-2 m}\right) .
\end{aligned}
$$

When $m \leqslant n<2 m$,
$$
\begin{aligned}
& \left(p^{m}+q^{m}, p^{n}+q^{n}\right) \\
= & \left(p^{m}+q^{m},\left(p^{m}+q^{m}\right)\left(p^{n-m}+q^{n-m}\right)-p^{n-m} q^{n-m}\left(p^{2 m-n}+q^{2 m-n}\right)\right) \\
= & \left(p^{m}+q^{m}, p^{2 m-n}+q^{2 m-n}\right) .
\end{aligned}
$$

Let $\left(m^{\prime}, n^{\prime}\right)=\left\{\begin{array}{l}(m, n-2 m), \text { when } n \geqslant 2 m, \\ (m, 2 m-n), \text { when } m \leqslant n<2 m.\end{array}\right.$
Then we have $I\left(m^{\prime}, n^{\prime}\right)=I(m, n), m^{\prime}+n^{\prime} \equiv m+n(\bmod 2)\left(m^{\prime \prime}, n^{\prime}\right)=(m, n)$.
When $(m, n)=1$, by continuously performing the above transformation, we will eventually have $\left(m^{\prime}, n^{\prime}\right)=(1,0)$ or $\left(m^{\prime}, n^{\prime}\right)=(1,1)$. Thus, we have $\left(p^{m}+q^{m}, p^{n}+q^{n}\right)=\left\{\begin{array}{l}2, \text { when } m+n \text { is odd, } \\ p+q, \text { when } m+n \text { is even. }\end{array}\right.$
Note: The above problem is a generalization of the following 1996 Japanese Mathematical Olympiad problem.
Given $m, n \in \mathbf{N},(m, n)=1$, find $\left(5^{m}+7^{m}, 5^{n}+7^{n}\right)$, where $(m, n)$ denotes the greatest common divisor of $m$ and $n$.