CEMC Banner

Problem of the Week
Problem E
It’s the Ones that We Want

The sum of the first \(n\) positive integers is \(1+2+3 + \cdots + n\).
We define \(a_n\) to be the ones digit of the sum of the first \(n\) positive integers.

For example,

\[\begin{aligned} 1=1 \ \ &\text{and} \ \ a_1 = 1,\\ 1+2=3 \ \ &\text{and} \ \ a_2 = 3,\\ 1 + 2 + 3 = 6 \ \ &\text{and}\ \ a_3 = 6,\\ 1 + 2 + 3 + 4 = 10 \ \ &\text{and}\ \ a_4 = 0,\\ 1 + 2 + 3 + 4 + 5 = 15 \ \ &\text{and}\ \ a_5 = 5. \end{aligned}\] Thus, \(a_1 + a_2 + a_3 + a_4 + a_5 = 1 + 3 + 6 + 0 + 5 = 15\).

Determine the smallest value of \(n\) such that \(a_1 + a_2 + a_3 + \cdots + a_n \geq 2024\).