<s>[INST] Prove that the last digit of $\frac{n(n+1)}{2}$ is never 9 The original question was

If the last digit of $\sum_1^n n^3$ is 1, then the last digit of $\sum_1^n n$ is ______?

The sum of the cubes of natural numbers is equal to the square of the sum of the natural numbers. Since the last digit of the sum of cubes is 1, the last digit of the sum of numbers can be either 1 or 9. Substituting n=1..13 in the formula $\frac{n(n+1)}{2}$ gives numbers which end in 1, but never a number ending in 9. The answer key also mentions the answer to be 1, but not 9.
Please conclusively prove why $\sum_1^n n$ can never end with a 9.
 [/INST] If $\dfrac{n(n+1)}2=r, 8r+1=(2n+1)^2$
Now for any odd  number $2n+1, (2n+1)^2\equiv1,5,9\pmod{10}$
$8r+1\equiv1,5,9\pmod{10}$
$\iff8r\equiv0,4,8\pmod{10}$
$\iff4r\equiv0,2,4\mod5$
$\iff r\equiv0,3,1\pmod5$
$\implies r\equiv0,0+5,3,3+5,1,1+5\pmod{10}$
</s>