Question 1019200
From Bezout's lemma (or Euclidean algorithm), there exist integers *[tex \large x] and *[tex \large y] such that *[tex \large \gcd(m,n) = xm + yn].


Since *[tex \large a^m - 1] is divisible by d, then *[tex \large a^m \equiv 1 \pmod{d} \Rightarrow a^{xm} \equiv 1 \pmod{d}]. Note that the exponent *[tex \large xm] could be negative, but this is okay, since this still obeys the rules of modular arithmetic (if e > 0, then *[tex \large a^{-e} = (a^{-1})^e \pmod{d}], where *[tex \large a^{-1}] is defined as the integer *[tex \large b] such that *[tex \large ab \equiv 1 \pmod{d}] (if an inverse exists). In particular, a and d are relatively prime, so an inverse of a exists mod d.


Similarly, *[tex \large a^{yn} \equiv 1 \pmod{d}]. 


It follows that *[tex \large a^{xm + yn} \equiv 1 \cdot 1 \equiv 1 \pmod{d}], or *[tex \large a^{xm + yn} - 1] is divisible by d. Since we expressed gcd(m,n) = xm + yn, it follows that d divides *[tex \large a^{\gcd(m,n)} - 1].