<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] Our sum is odd, so all we need to do is to compute it modulo $5$.
Note that the congruence class of $k^n$ modulo $5$ is the same as the congruence class of $k^{n+4}$ modulo $5$. This is obvious if $k$ is divisible by $5$. And if $k$ is not divisible by $5$ then $k^4\equiv 1\pmod{5}$.
So to find the last digit for any $n$, it is enough to know the last digit for $n=1,2,3,4$. Now you need to compute the last digit for $n=1,2,3,4$, and you will know the situation for all $n$.
</s>