5. Determine the sum of all digits of all natural numbers that are less than or equal to the number 2016.

Each task is scored out of 10 points.

The use of a pocket calculator or any reference materials is not allowed.

## COUNTY COMPETITION IN MATHEMATICS
5. The sum of the digits of all single-digit numbers is 45.

$1 \text{ POINT}$

The sum of the digits of all two-digit numbers will be obtained by adding all the digits in the tens place $(10 \cdot 45)$ and all the digits in the units place $(9 \cdot 45)$:

$10 \cdot 45 + 9 \cdot 45 = 19 \cdot 45 = 855$

The sum of the digits of all numbers from 1 to 99 (less than 100) is $45 + 855 = 900$.

The sum of the digits of all three-digit numbers from 100 to 999 is the sum of all the digits in the hundreds place $(100 \cdot 45)$ plus the sum of all the digits in the two-digit "endings" (9 $\cdot$ 900):

$100 \cdot 45 + 9 \cdot 900 = 4500 + 8100 = 12600$

2 POINTS

The sum of the digits of all numbers from 1000 to 1999 is

$1000 \cdot 1 + 900 + 12600 = 14500$.

2 POINTS

The sum of the digits of the numbers from 2000 to 2016 is $17 \cdot 2 + 45 + 7 + 21 = 107$.

2 POINTS

Note: Regardless of the method of solving, the steps in the solution must be validly justified.

If a student correctly sets up the problem but makes a calculation error in one of the parts of the problem, deduct only the points for that part of the problem, not the points for the final solution.