Find $x$ such that $\sum_{k=1}^{2014} k^k \equiv x \pmod {10}$ Find $x$ such that $$\sum_{k=1}^{2014} k^k \equiv x \pmod {10}$$

I knew the answer was $3$.

We are going to compute the sum mod $2$ and mod $5$. The Chinese Remainder Theorem then gives us the result mod $10$.
Mod $2$, obviously $$k^k \equiv \begin{cases}0 & \text{if }k\text{ even,}\\1 & \text{if }k\text{ odd,}\end{cases}$$
so
$$\sum_{k = 0}^{2014} \equiv \frac{2014}{2} = 1007 \equiv 1 \mod 2.$$
By Fermat, $k^k$ mod $5$ only depends on the remainder of $k$ mod $\operatorname{lcm}(5, 4) = 20$. So $$\sum_{k = 1}^{2014}k^k \equiv \underbrace{100}_{\equiv 0} \cdot \sum_{k=1}^{20} k^k + \sum_{k=1}^{14} k^k \\ \equiv 1 + 4 + 2 + 1 + 0 + 1 + 3 + 1 + 4 + 0 + 1 + 1 + 3 + 1 \\\equiv 3 \mod 5.$$
Combining the results mod $2$ and mod $5$, $$\sum_{k=1}^{2014} k^k \equiv 3\mod 10.$$
