5. Natural numbers are arranged in a table as shown.

| 1 |  |  |  |  |  |  |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| 2 | 3 |  |  |  |  |  |
| 4 | 5 | 6 |  |  |  |  |
| 7 | 8 | 9 | 10 |  |  |  |
| 11 | 12 | 13 | 14 | 15 |  |  |
| 16 | 17 | 18 | 19 | 20 | 21 |  |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |

The table continues by writing natural numbers so that each subsequent row contains one more number than the previous row. Determine the sum of all numbers in the row $u$ where the number 1000 is located.

## NATIONAL MATHEMATICS COMPETITION

Poreč, 28. - 30. March 2019.
5. The last numbers in each row form a sequence: $1,3,6,10,15,21,28, \ldots$ where the second term is 2 greater than the first, the third term is 3 greater than the second, the fourth term is 4 greater than the third, the fifth term is 5 greater than the fourth, and so on, thus:

- the first row of the table ends with the number 1,
- the second row of the table ends with the number $1+2=3$,
- the third row of the table ends with the number $1+2+3=6$,
- the fourth row of the table ends with the number $1+2+3+4=10$,
- the fifth row of the table ends with the number $1+2+3+4+5=15, \ldots$

In general, the $n$-th row of the table ends with the number $1+2+3+4+\ldots+n=\frac{n(n+1)}{2}$.

For $n=44$ we get $\frac{n \cdot(n+1)}{2}=\frac{44 \cdot 45}{2}=22 \cdot 45=990$.

For $n=45$ we get $\frac{n \cdot(n+1)}{2}=\frac{45 \cdot 46}{2}=45 \cdot 23=1035$.

Therefore, the number 1000 is in the 45th row of the table, which starts with the number 991 and ends with the number 1035, so we need to calculate the sum $991+992+993+\ldots+1035$.

This follows:

$991+992+993+\ldots+1035=1+2+3+\ldots+1035-(1+2+3+\ldots+990)$

$=\frac{1035 \cdot 1036}{2}-\frac{990 \cdot 991}{2}=1035 \cdot 518-495 \cdot 991$

$=536130-490545=45585$.

## NATIONAL MATHEMATICS COMPETITION