<s>[INST] Find the rightmost digit of: $1^n+2^n+3^n+4^n+5^n+6^n+7^n+8^n+9^n$ Find the rightmost digit of: $1^n+2^n+3^n+4^n+5^n+6^n+7^n+8^n+9^n(n$ arbitrary positive integer)
First of all I checked a few cases for small $n$'s and in all cases the rightmost digit was $5$, so maybe this is the case for all values of $n$.
Then I thought maybe it's better to consider odd and even cases for $n$ but there's no unified rule here, because for example: $8^2\equiv{4}\pmod{10}$ and  $8^4\equiv{6}\pmod{10}$. Any ideas??
 [/INST] If $n$ is odd, then as in the answer by @Semiclassical, $1^n+2^n+3^n+4^n+5^n+6^n+7^n+8^n+9^n\equiv5\pmod{10}.$
If $n$ is even, say $n=2m,$ then first observe $4^m\equiv 5+(-1)^m\pmod{10}$ and $9^m\equiv(-1)^m\pmod{10}.$
So we have
 $\begin{align}1^n+2^n+3^n+4^n+5^n+6^n+7^n+8^n+9^n&\equiv2(1+2^n+3^n+4^n)+5^n\\&\equiv2(1+(5+(-1)^m)+((-1)^m)+(5+(-1)^{2m}))+5\\
&\equiv4(1+(-1)^m)+5\pmod{10}\end{align}$  
Hope this helps.
</s>