If $p$ and $q$ are distinct primes and $a$ be any integer then $a^{pq} -a^q -a^p +a$ is divisible by $pq$.

Hint Look at this $\pmod{p}$ and $\pmod{q}$. If you prove that your expression is $0$ in both modular arithmetics, you are done.

$\pmod{p}$ you have $a^p \equiv a \pmod{p}$ therefore you also have $$(a^p)^q \equiv a^q \pmod{p}$$

$\pmod{q}$ you can do a similar computation.


For prime $q,$ $$a^{pq}-a^q-a^p+a=[(\underbrace{a^p})^q-(\underbrace{a^p})]-[a^q-a]$$

Now by Fermat's Little Theorem, $b^q\equiv b\pmod q$ where $b$ is any integer

Set $b=a^p, a$

Similarly for prime $p$

Now if $p,q$ both divides $a^{pq}-a^q-a^p+a,$ the later must be divisible by lcm$(p,q)$