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$.
 A: This is asking for the last digit of that sum. So we may ignore everything but the last digit of each number. Now eliminate the few last terms for a minute and consider:
$$(1^1+\cdots +9^9)+(1^{11}+\cdots +9^{19})+\cdots+(1^{2001}+\cdots +9^{2009})\equiv \,?\pmod{10}$$
Notice that we can now pair each digit and form geometric progressions:
$$\begin{align*}&\quad(1^1+\cdots +1^{2001})+(2^{2}+\cdots +2^{2002})+\cdots+(9^{9}+\cdots +9^{2009})\\[7pt]&=1(1^0+1^{10}+\cdots+1^{2000})+2^2(2^0+2^{10}+\cdots+2^{2000})+9^9(9^0+9^{10}+\cdots 9^{2000})\\[7pt]\end{align*}$$
Rather than writing out the geometric series compactly, let's take it each separately:
$$1^0+1^{10}+\cdots+1^{2000}\equiv 201\equiv 1\pmod{10}$$
$$2^0+2^{10}+\cdots+2^{2000}\equiv 1+\underbrace{4+6+4+\cdots +6}_{200}\equiv 1\pmod{10}$$
$$3^0+3^{10}+\cdots+3^{2000}\equiv 1+\underbrace{9+1+9+\cdots +1}_{200}\equiv 1\pmod{10}$$
$$\cdots$$
$$9^0+9^{10}+\cdots+9^{2000}\equiv 1+\underbrace{1+1+1+\cdots +1}_{200}\equiv 1\pmod{10}$$
Now back to the original expression, we are left with:
$$1+2^2+\cdots+9^9\equiv 7\pmod{10}$$
We have a few more terms to consider, namely:
$$1^{2011}+2^{2012}+3^{2013}+4^{2014}\equiv 6\pmod{10}$$
Hence:
$$\sum_{k=1}^{2014} k^k\equiv 3\pmod{10}$$
(I have left out some of the more trivial computations to avoid clogging this answer with tedious modular arithmetic)
A: 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.$$
A: Hint: You can work directly modulo $10$, or modulo $5$, since the sum modulo $2$ is clear.
The value of $a^b$ modulo $p$, for fixed $b$, cycles nicely.  By Fermat's Theorem, or Euler's Theorem, there is also nice cycling for fixed $a$ and variable $b$. Putting these things together, you should be able to detect and prove cycling in the value of $k^k$ modulo $5$ or $10$. 
