Let $p, q$ be prime and $a$ some positive integer such that $a = pq + r$ where $r$ is the remainder. Show that $p \mid a^p – r$ and $q \mid a^q – r$.
Example: $p = 3$ and $q = 5$, $a = 17$ and $r = 17 – 3\cdot5 = 2$: $$\begin{align*}\frac{17^5 – 2}5 &= \frac{1419857 – 2}5\\ & = 1419855/5\\ & = 283971\end{align*}$$
Hint: Corollary to Euler's Theorem: For prime $p$ and integer $a$, $a^p\equiv a \pmod{p}$