TITLE: CRT + Fermat's Little Theorem
QUESTION [5 upvotes]: I am seeking a proof for the following...
Suppose $p$ and $q$ are distinct primes. Show that $$
p^{q-1} + q^{p-1} \equiv 1 \quad (\text{mod } pq)$$
$$$$
$$$$
I gather from Fermat's Little Theorem the following:
$$q^{p-1} \equiv 1 \quad (\text{mod } p)$$
and
$$p^{q-1} \equiv 1 \quad (\text{mod } q)$$
How can I use this knowledge to give a proof? I'm confident I can combine this with the Chinese Remainder Theorem, but I am stuck from here.

REPLY [5 votes]: first using Fermat's theorem,
$q^{p-1}\equiv 1 \pmod p$
Also,$\ \ \ p^{q-1}\equiv0 \pmod p$
Second using Fermat's theorem,
$p^{q-1}\equiv 1 \pmod q$
Also,$q^{p-1}\equiv0 \pmod q$
Using first part we get,
$q^{p-1}+p^{q-1}\equiv1 \pmod p$
using second part we get,
$p^{q-1}+q^{p-1}\equiv1 \pmod q$
Since $p$ and $q$ are distinct prime, therefore $\gcd (p,q)=1$
$q^{p-1}+p^{q-1}\equiv1 \pmod {pq}$