# Last digit in $\sum_{k=1}^{999}k^m$ (olympiad question)

I'm trying to prepare myself for mathematics olympiad. I faced a problem which is kind of interesting, here is the question:

Oleg chose a positive integer like $$m$$ and Andrew found the following summation : \begin{align} 1^m +2^m + \cdots + 998^m+ 999^m \end{align} What is the last digit of this sum ?

For example if $$m = 1$$ then we have :

\begin{align} 1+2+3+\cdots+998+999 = \frac{999 \times 1000}{2} = 499500 \end{align} So the answer is $$0$$ when $$m=1$$

• Hint: split the sum up into ten subsums according to the last digit of the integer being raised to the $m$th power, such as $3^m + 13^m + 23^m + \cdots + 993^m$. What is the last digit of each of these subsums? – Greg Martin Oct 27 '20 at 7:37

## 3 Answers

You can add $$1000^m$$ to the sum as it will not change the last digit as its last digit is $$0$$. Last digits of $$1^m,11^m,21^m,...,991^m$$ are the same. Similarly for $$2^m,12^m,...,992^m$$ and so on till $$10^m, 100^m,...1000^m$$. So the ones digit of $$1^m+2^m+...+10^m$$ is the same as that of $$11^m+12^m+...+20^m$$ and so on. There are $$100~10$$s in $$1000$$, so the ones digit of the sum is$$(1^m+2^m+...+10^m)*100\mod10$$which is $$0$$.

• Thanks, I got it – A maths freak Oct 27 '20 at 7:53

Just split the numbers into a group such that the numbers ending with same digit fall in one group. It is like $$(1^m+11^m+...+991^m) +(2^m+12^m+992^m)+\cdots$$.

We can add $$1000^m$$ as it will not change the last digit.

If we look into the subgroup we will have $$100$$ numbers in every subgroup (you can find it by using arithmetic progression formula, $$l=a+(n-1)d$$). We have the same last digit for every number in the same group. So if we multiply the number with 100 we will get the last digit number as 0 for every m.

Therefore the last digit is zero.

Yes , you can find out the answer by keeping the value of m=1 and this will be easier of it is a objective type question.

But in descriptive type you cannot simply keep m=1 on deduce the answer.

Just a hint about a special case : if $$n$$ is odd, you can easily see the much stronger result : $$1^m +2^m + \cdots + 998^m+ 999^m \equiv 0 \quad[500]$$

Indeed, $$1^m +2^m + \cdots + 998^m+ 999^m = (1^m + 999^m)+(2^m+998^m)+...+(449^m+501^m)+500^m$$ $$\equiv (1^m+(-1)^m) +(2^m + (-2)^m)+...+(499^m+(-499^m)) + 500^m \quad [500]$$ $$\equiv (1^m-1^m) +(2^m -2^m)+...+(499^m-499^m) + 500^m \equiv 0 \quad [500]$$