How many natural numbers with at most six digits are there in which the digit 1 occurs?
Preliminary note. Several contestants decided how many numbers containing the digit 1 there are among the one-, two-, ..., six-digit numbers, and they answered the question by giving the sum of these six numbers. A similar but simpler solution is the following.

I. Solution: The numbers that can be written with one, or two, or ..., or six digits, i.e., numbers that require at most six digits, can all be written with exactly six digits if we allow the digit 0 to be used as a leading digit, and if we think of writing as many 0s in front of every number that can be written with at most five digits so that the number of its digits is six.

Let $F_{n}$ denote the number of numbers containing the digit 1 that can be written with at most $n$ digits. Thus, clearly $F_{1}=1$, because half of the one-digit numbers meet the condition: the number 1, and our task is to determine $F_{6}$. Suppose we already know $F_{n}$; then we can get $F_{n+1}$ with the following reasoning. Group the numbers containing the digit 1 that can be written with at most $n+1$ digits according to their leading digit. The number of those starting with 1 is $10^{n}$, because in them we can write any of the 10 digits in the remaining $n$ places, independently of each other. The number of those starting with $0,2,3,4, \ldots 9$ is $F_{n}$ in each group, because these must contain a 1 in their remaining $n$-digit part. This way we have considered all the suitable $n+1$-digit numbers, each exactly once, so

$$
F_{n+1}=10^{n}+9 \cdot F_{n}
$$

With this, we have obtained a so-called recursive formula for calculating $F_{n}$. Thus, $F_{2}=10+9 \cdot F_{1}=19, F_{3}=100+9 \cdot 19=271$, $F_{4}=1000+9 \cdot 271=3439, F_{5}=10000+9 \cdot 3439=40951$, and finally $F_{6}=100000+9 \cdot 40951=468559$. This answers the question.

II. Solution: Group the numbers in question according to the place of their first 1, i.e., the leftmost 1, which is in the units, tens, hundreds, ..., hundred-thousands place. This way we get six groups, and each of our numbers falls into exactly one group. In the construction, the place of the mentioned 1, except for itself, must be filled in such a way that any digit can stand after the mentioned 1, and any digit other than 1 can stand before it.

In the first group, the units place, or the rightmost digit, of the numbers is 1, and they do not contain any more 1s. For the tens place, we need to consider all 9 digits other than 1. For the hundreds place, again, the 9 digits can be used in 9 ways, so there are $9 \cdot 9$ ways to fill the tens and hundreds places. Similarly, the next three places can be filled in 9 ways each, so this group contains $9^{5}$ numbers.

In the second group, the tens place is 1, and the digit in the units place can be any of the 10 digits, and the four preceding digits can again be chosen in 9 ways each, so in this group we get $9^{4} \cdot 10$ numbers. - Moving from group to group, one more place can be filled in 10 ways instead of 9, so the total number of numbers containing 1 is from the six groups:

$$
N=9^{5}+9^{4} \cdot 10+9^{3} \cdot 10^{2}+9^{2} \cdot 10^{3}+9 \cdot 10^{4}+10^{5}
$$

Notice that the six terms of this sum form a geometric sequence with a common ratio of $10 / 9$, so using the sum formula, $N=468559$.

III. Solution: Using combinatorial knowledge and the binomial theorem, the number of the numbers in question can also be obtained by grouping them according to the number of 1s they contain, constructing them in their six-digit extended form. The single 1 in the numbers that contain only one 1 can be placed in any of the 6 positions, and the other 5 positions can be filled with the other 9 digits in all possible ways, so the number of such numbers is $6 \cdot 9^{5}$. The positions of the 1s in the numbers that contain exactly two, three, ..., six 1s can be chosen in

$$
\binom{6}{2}, \quad\binom{6}{3}, \quad\binom{6}{4}, \quad\binom{6}{5}, \quad\binom{6}{6}=1
$$

ways, and after each choice, the remaining $4,3,2,1$ positions can be filled in $9^{4}, 9^{3}, 9^{2}, 9$ ways, or in the last case, we are done, as there are no more positions to fill. Based on this, the number we are looking for is

$$
N=6 \cdot 9^{5}+\binom{6}{2} \cdot 9^{4}+\binom{6}{3} \cdot 9^{3}+\binom{6}{4} \cdot 9^{2}+\binom{6}{5} \cdot 9+1
$$

Notice that by adding $9^{6}$ as the first term to this expression of $N$, we get the expansion of $(9+1)^{6}$. Based on this,

$$
N=(9+1)^{6}-9^{6}=10^{6}-9^{6}=1000000-531441=468559
$$

IV. Solution: We can arrive at the last result more simply as follows. Consider all six-digit and six-digit writable numbers, including 0 in the form 000000, their number is $999999+1$, or $10^{6}$, because we take all 10 digits for each of the six places independently. To get the numbers that meet the requirement, we exclude the numbers that do not contain the digit 1, i.e., all those in which a digit other than 1 stands in each of the 6 places. Their number is $9^{6}$, so $N=10^{6}-9^{6}$. (In the process, we also excluded 0.)

Remarks: 1. The sum obtained in the second solution can be brought to the form $10^{6}-9^{6}$ obtained in the third solution by multiplying it by 1 in the form $10-9$.

2. In the fourth solution, we used the fact that the set of all natural numbers with at most six digits, and the set of numbers to be excluded due to not containing the digit 1 - including 0 in both sets - are identical to the 6-permutations with repetition of 10, and 9, respectively, different digits.

3. Generalizations: a) In none of the solutions did we use the fact that the distinguished digit is precisely 1. Therefore, the number of natural numbers with at most six digits in which a given arbitrary (non-zero) digit occurs is: 468559.

b) The reasoning in each solution can also be applied when we are looking for the number of natural numbers with at most $n$ digits in which a given (non-zero) digit occurs. Their number (e.g., from the fourth solution) is $10^{n}-9^{n}$.

c) Examining the same question in an arbitrary base $k$ number system - where $k$ is a natural number greater than 1, and the digit in question is not 0 - the number of numbers that meet the requirement is

$$
k^{n}-(k-1)^{n}
$$

[^0]:    ${ }^{1}$ In line with the content of the problem, it is enough to say "number" instead of "natural number" for short.

    ${ }^{2}$ Alternatively: these numbers range from 100 ... 0 to 199 ... 9, where the number of 0s and 9s is $n$, - so their number is 