<s>[INST] Prove that $b_n = b_{n+100}$ 
Let $b_n$ denote the units digit of $\displaystyle\sum_{a=1}^n a^a$. Prove that $b_n = b_{n+100}$.

I tried rewriting the sum, but didn't see how to prove the equality. For example, if $n = 178$ we have $$\displaystyle\sum_{a=1}^{178} a^a = (1^1+2^2+3^3+\cdots+78^{78})+(79^{79}+80^{80}+81^{81}+\cdots+178^{178})$$ and so we need to show that $79^{79}+80^{80}+81^{81}+\cdots+178^{178} \equiv 0 \pmod{10}$. Is there an easier way to prove the general result?
 [/INST] We can reduce the numbers to the residues modulo $10$, i.e:
$$79^{79} + 80^{80} + \cdots + 178^{178} \equiv 9^{79} + 0^{80} + \cdots + 8^{178} \pmod {10}$$
Now note that for each residues we have exactly $10$ numbers such that it appears in the base of the exponent. Group them and take one group. Now notice as their parity is equal the sum in the group is always even, so hence divisible by $2$. Now it's enough to prove it's divisible by $5$. Now if the base of the exponent is divisible by $5$ we're done, so assume it's not. Hence they are coprime. Now note that we can reduce the exponents modulo $4$, as $a^{4} \equiv 1 \pmod 5$ by Fermat's Theorem and as $\frac{4}{(4,10)} = 2$ the exponents will repeat in cycles of two, so we can group them in $5$ groups having same remainder, hence the sum is divisible by $5$.

For a better illustration of the last step check this:
$$79^{79} + 89^{89} + 99^{99} + 109^{109} + 119^{119} + 129^{129} + 139^{139} + 149^{149} + 159^{159} + 169^{169} $$
$$\equiv 9^{79} + 9^{89} + 9^{99} + 9^{109} + 9^{119} + 9^{129} + 9^{139} + 9^{149} + 9^{159} + 9^{169} $$
$$\equiv 9^{3} + 9^{1} + 9^{3} + 9^{1} + 9^{3} + 9^{1} + 9^{3} + 9^{1} + 9^{3} + 9^{1} \equiv 5(9^3 + 9^1) \equiv 0 \pmod 5$$
</s>