Question 346
For a positive integer $n$, let $d_n$ be the units digit of $1 + 2 + 3 + \dots + n$. Find the remainder when \[ \sum_{n=1}^{2017} d_n \] is divided by 1000.
Xem đáp án và lời giải
Đáp án: $69$
Any 20 consecutive positive integers have units digits whose sum is \[ \begin{aligned} &0 + 1 + 2 + \dots + 9 + 0 + 1 + 2 + \dots + 9 \\ &= 2(1 + 9) + 2(2 + 8) + 2(3 + 7) + 2(4 + 6) + 2(5) = 90. \end{aligned} \] Therefore $d_{n+20} = d_n$ for all integers $n \geqslant 1$. Thus one only needs to calculate $d_n$ for $1 \leqslant n \leqslant 20$, and \[ (d_1, d_2, \ldots, d_{20}) = (1, 3, 6, 0, 5, 1, 8, 6, 5, 5, 6, 8, 1, 5, 0, 6, 3, 1, 0, 0). \] Therefore \[ \sum_{n=1}^{2017} d_n = 101 \sum_{n=1}^{20} d_n - \sum_{n=18}^{20} d_n = 101 \cdot 70 - 1 = 7069. \] The requested remainder is 69.