TITLE: Divisibility of $a^p-r$ and $a^q-r$ by the primes $p,q$
QUESTION [0 upvotes]: 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*}$$

REPLY [1 votes]: Hint: Corollary to Euler's Theorem: For prime $p$ and integer $a$, $a^p\equiv a \pmod{p}$
{"set_name": "stack_exchange", "score": 0, "question_id": 879500}