Proof

We first prove the special case

If m | n, then (Xm - 1) | (Xn - 1).

From this we derive the general case

gcd(Xm - 1,Xn - 1) = Xgcd(m,n) - 1.