Problem. Let $a \in \mathbb{Z}$ and $a \geq 2$, and let $q$ be a prime. Prove that $\gcd(a-1,\frac{a^q-1}{a-1})$ is either $1$ or $q$.
Attempts. By Fermat's Little Theorem, since $q$ is prime, $a^q \equiv a \,\,\mathrm{mod}\,q$, i.e. $a^q = a+qk$ where $k$ is some positive integer. Then the problem reduces to show $\gcd(a-1, 1+\frac{qk}{a-1})$ is $1$ or $q$. Then I went into different cases such as when $a-1$ divides $q$ and when it does not etc. but got nowhere.
Comment. I'm a undergraduate beginner to number theory. Please be kind. And I just need a hint. Thank you.