2019 Mock AMC 10B Problems/Problem 22

Problem

Let $S = \{r_1, r_2, r_3, ..., r_{\mu}\}$ be the set of all possible remainders when $15^{n} - 7^{n}$ is divided by $256$, where $n$ is a positive integer and $\mu$ is the number of elements in $S$. The sum $r_1 + r_2 + r_3 + ... + r_{\mu}$ can be expressed as\[p^qr,\]where $p, q, r$ are positive integers and $p$ and $r$ are as small as possible. Find $p+q+r$.

$\textbf{(A)}\ 40\qquad\textbf{(B)}\ 41\qquad\textbf{(C)}\ 42\qquad\textbf{(D)}\ 43\qquad\textbf{(E)}\ 44$

Solution

$15^n - 7^n \equiv 7^n - 7^n \equiv 0$ $\text{mod}$ $8$ for all integer $n > 0$. Therefore, $S = \{0, 8, 16, 24,...,248\}$. Since the sum of all elements in $S$ is $8 + 16 + 24 + ... + 248 = 8(1 + 2 + 3 + ... + 31) = 8 \cdot \frac{31(31 + 1)}{2} = 2^7 \cdot 31$, the answer is $2 + 7 + 31 = \boxed{\text{(A)} 40}$.