Determine the number of four-digit (natural) numbers in which the sum of the digits is 5, or 6, or 7, without writing down all such numbers.

Let's determine the number of four-digit (natural) numbers in which the sum of the digits is 5, 6, or 7, without listing all such numbers.
I. solution. Among the representations listed in the table, those that are the sum of four digits, regardless of order, are as follows.

$$
\begin{array}{rr}
5=5+0+0+0 & A \\
4+1+0+0 & B \\
3+2+0+0 & B \\
3+1+1+0 & D \\
2+2+1+0 & D \\
2+1+1+1 & G
\end{array}
$$

$$
\begin{aligned}
& 6=6+0+0+0 \quad A \\
& 5+1+0+0 \quad B \\
& 4+2+0+0 \quad B \\
& 4+1+1+0 \quad D \\
& 3+3+0+0 \quad C \\
& 3+2+1+0 \quad E \\
& 3+1+1+1 \quad G \\
& 2+2+2+0 \quad C \\
& 2+2+1+1 \quad F
\end{aligned}
$$

$$
\begin{aligned}
& 7=7+0+0+0 \quad A \\
& 6+1+0+0 \quad B \\
& 5+2+0+0 \quad B \\
& 5+1+1+0 \quad D \\
& 4+3+0+0 \quad B \\
& 4+2+1+0 \quad E \\
& 4+1+1+1 \quad G \\
& 3+3+1+0 \quad D \\
& 3+2+2+0 \quad D \\
& 3+2+1+1 \quad H \\
& 2+2+2+1 \quad G
\end{aligned}
$$

To determine how many four-digit numbers can be formed from the digits of each representation, considering the order, we need to consider the number of digits different from zero - since zero cannot be the first digit - and the equality among the digits. Some of the representations can be considered of the same type - as indicated by the capital letter labels - for example, $3+2+0+0$ and $4+3+0+0$ are of the same type because they contain two zeros and two other different digits. It is obvious that the same number of different ordered numbers can be formed from representations of the same type.

From the $A$ type representations, only 1 four-digit number can be formed, as the non-zero digit can only be in the first position. For the $B$ type, the first position can be filled in 2 ways - for example, in the case of $4+1+0+0$, we can write 4 or 1 there - then the position of the other different digit can be chosen in 3 ways, and finally, the two equal digits are written in the remaining empty positions. Continuing the example with the number starting with 4:

$$
4100 ; \quad 4010 ; \quad 4001 .
$$

Thus, from each $B$ type representation, $2 \cdot 3=6$ valid numbers can be obtained. Similarly, for the $C$ type, 3 numbers can be formed, for the $F$ type again 6 (since after filling the first position, the remaining set of digits is the same as in $B$), and from the $G$ type, with 4 ways to choose the position of the digit that appears only once, 4 numbers.

For the $E$ type representations, the first position can be filled in 3 ways, the next in 3 ways for each starting digit - now even with 0 - the third in 2 ways from the remaining two digits, and thus the digit that ends up in the last position is always determined. Thus, $3 \cdot 3 \cdot 2=18$ different orders are obtained. Similarly, it turns out that if we start with 1 for $H$, we get $3 \cdot 2=6$ numbers, and starting with 2 and 3, we get 3 each, like in $C$, totaling 12. Finally, for $D$, 6 orders are obtained similarly when starting with the repeating digit, and 3, like in $B$, when starting with the non-zero digit that appears only once, totaling 9.

Summarizing, the number of four-digit numbers that can be formed from the
$A$,
$B, \quad C$,
$D$,
$E$,
$G$,
$H$

type representations are respectively

$1, \quad 6, \quad 3, \quad 18$

$18, \quad 6$,

$6, \quad 4$,

12,

thus the number of numbers sought for the sum of digits being 5, 6, and 7, respectively, is

$$
\begin{array}{lr}
1+2 \cdot 6+2 \cdot 9+4 & =35 \\
1+2 \cdot 6+2 \cdot 3+9+18+6+4 & =56 \\
1+3 \cdot 6+3 \cdot 9+18+2 \cdot 4+12 & =84
\end{array}
$$

Katona Viktor (Heves, General Secondary School II. grade) Blaskó Gábor (Kazincbarcika, Irinyi J. Chemical Industry Technical School II. grade)

II. solution. A four-digit number can be visualized by starting from a point on a straight line and successively measuring segments of length equal to the first, then the second, the third, and finally the fourth digit. To highlight the zeros, instead of the second, third, and fourth digits, we measure segments one unit longer. This way, a four-digit number, where the sum of the digits is $n$, is represented by a segment of length $n+3$, which is divided into 4 parts by 3 internal points. Conversely, we can uniquely read off which number a divided segment represents, if the length of each part is an integer multiple of the unit, not greater than 10 times. In our case, the value of $n$ is 5, 6, or 7, so the length of each part is also less than 10. The number of numbers in question is therefore equal to the number of ways to choose 3 points from the $n+2$ internal division points of a segment divided into $n+3$ parts.

An internal point can be chosen in $n+2$ ways, the second from the remaining in $n+1$ ways, and the third in $n$ ways; however, in this way, we get the same triplet of points, whether we chose the leftmost, middle, or rightmost point first, and from the other two, we could choose either one second and the other third. Thus, we have $(n+2)(n+1) n$ ways to choose 3 points, but in this way, we got each triplet of points $3 \cdot 2$ times, so

$$
\frac{(n+2)(n+1) \cdot n}{3 \cdot 2}
$$

is the number of different ways to choose 3 internal points, and this is also the number of four-digit numbers sought, if $n=5,6$ or 7, that is,

$$
\frac{7 \cdot 6 \cdot 5}{3 \cdot 2}=35, \quad \frac{8 \cdot 7 \cdot 6}{3 \cdot 2}=56, \quad \text { or } \quad \frac{9 \cdot 8 \cdot 7}{3 \cdot 2}=84
$$