Task 1 - 331211 Determine all natural numbers $n$ for which the following conditions are satisfied:

The number $n$ is ten-digit. For the digits of its decimal representation, denoted from left to right by $a_{0}, a_{1}$, $\ldots, a_{9}$, it holds that: $a_{0}$ matches the number of zeros, $a_{1}$ matches the number of ones, ..., $a_{9}$ matches the number of nines in the decimal representation of $n$.
For a natural number $n$ with digits $a_{0}, \ldots, a_{9}$, if the conditions are satisfied, then:

Adding the individual counts $a_{0}, \ldots, a_{9}$ results in the total count of 10 digits of $n$; i.e.,

$$
a_{0}+\ldots+a_{9}=10
$$

Since $n$ is ten-digit, the leading digit, also denoted by $k$, is not 0:

$$
a_{0}=k \geq 1
$$

The $k$ digits that are 0 are thus among the digits $a_{1}, \ldots, a_{9}$; specifically:

Exactly $k$ of the digits $a_{1}, \ldots, a_{9}$ are 0,

exactly $9-k$ of the digits $a_{1}, \ldots, a_{9}$ are positive.

From (1) and (2) it follows: The sum of the digits $a_{1}, \ldots, a_{9}$ is $10-k$.

If, as found here in (3),(4), the sum of positive integers is exactly 1 greater than their count, then for them:

Exactly $8-k$ of the digits $a_{1}, \ldots, a_{9}$ are 1,

exactly one of the digits $a_{1}, \ldots, a_{9}$ is 2.

If $a_{0}=1$ or $a_{0}=2$, then according to this, among all $a_{\nu}$ there would either be one zero, $9-k=8$ ones, and one two, or two zeros, $8-k=6$ ones, and two twos.

In both cases, more than the three digits $a_{0}, a_{1}, a_{2}$ would be ones, and thus there would also be another digit $a_{p}$ with $p \geq 3$. This would mean: The digit $p$ would also appear with the count 1. However, since according to (6) all 10 digits of $n$ are already 0, 1, or 2, this is a contradiction.

Therefore, and because of (2), $a_{0} \geq 3$ must hold, and the counts $8-k$ and 1 of the digits 1 and 2 among the $a_{1}, \ldots, a_{9}$ mentioned in (5) are already these counts among all $a_{\nu}$. Together with the count $k$ of the digit 0, this gives the count 9 for the digits 0, 1, and 2. Thus, exactly one digit greater than 2 must appear among the $a_{\nu}$; this must therefore be the digit $a_{0}=k$. This statement in turn means: $a_{k}=1$.

Since, as noted in (5), exactly one of the digits is 2, i.e., $a_{2}=1$, the count $a_{1}$ of the ones is positive. Thus, four positive $a_{\nu}$ have already been verified; their sum is $a_{0}+a_{1}+a_{2}+a_{k}=k+(8-k)+1+1=10$.

Because of (1), the remaining six $a_{\nu}$ must be 0; thus, the count of zeros $a_{0}=6$ is determined, and in total it has been found: $n$ must be the number 6210001000.

Indeed, the decimal representation of this number has exactly 6 zeros, 2 ones, one two, one six, and none of the digits three, four, five, seven, eight, nine. Therefore, this number exactly satisfies the conditions of the problem.

## Adapted from $[5]$