<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] Given that the order of any of the components here will divide $4$, since that is the Carmichael function value for $10$, it is only necessary to check the values for $n=\{1,2,3, 4\}$. The results follow a pattern across the range of values (all $\bmod 10$):
$$\begin{array}{c|c}
n & 1^n & 2^n & 3^n & 4^n & 5^n & 6^n & 7^n & 8^n & 9^n & \sum  \\ \hline
1 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 5 \\ \hline
2 & 1 & 4 & 9 & 6 & 5 & 6 & 9 & 4 & 1 & 5 \\ \hline
3 & 1 & 8 & 7 & 4 & 5 & 6 & 3 & 2 & 9 & 5 \\ \hline
4 & 1 & 6 & 1 & 6 & 5 & 6 & 1 & 6 & 1 & 3 
\end{array}$$ 
and you can check that the following line for $n=5$ repeats the values for $n=1$ if required.
Thus the answer is that the last digit is $3$ when $n\equiv 0 \bmod 4$ and is $5$ otherwise.
</s>