6.1. All natural numbers from 1 to 2017 inclusive were written in a row. How many times was the digit 7 written?
Answer: 602.

Solution. First, consider the numbers from 1 to 2000. Then the digit 7 can be in the third position from the end: numbers of the form $7 * *$ or $17 * *$ - there are 200 such numbers. It can be in the second position: $* 7 *$ or $1 * 7 *$ - there are also 200 such numbers; or the last position: $* * 7$ or $1 * * 7$ - there are also 200. In addition, there are 2007 and 2017 - two more 7s.