TITLE: Show that $a^{q-1} \equiv 1 \pmod{pq}$
QUESTION [6 upvotes]: Assume that $p$ and $q$ are distinct add primes such that $p-1\mid q-1$. If $\gcd(a,pq)=1$ ,show that: $$a^{q-1} \equiv 1 \pmod{pq}$$

I have tried as follows:
$$a^{q-1} \equiv 1 \pmod{q} \quad \text{and} \quad a^{p-1} \equiv 1 \pmod{p}$$
$$\implies a^{(q-1)(p-1)} \equiv 1 \pmod{q} \quad \text{and} \quad a^{(q-1)(p-1)} \equiv 1 \pmod{p}$$
$$\implies a^{(q-1)(p-1)} \equiv 1 \pmod{pq}$$
But then I am stuck - please help.

REPLY [2 votes]: You know that:
$a^{p-1} \equiv 1$ mod $p$
but $(p-1)|(q-1)$ so this means that
$a^{q-1} \equiv 1$ mod $p$.
Now you may use the Chinese remainer theorem with your first congruence to tell you that
$a^{q-1} \equiv 1$ mod $pq$