## Task B-4.7.

How many odd seven-digit numbers are there consisting of the digits 2, 3, and 0 if each of these digits appears at least once in the number?
## First Solution.

The numbers with the described properties are odd, so the last digit is 3.

Since 0 cannot be the first digit, we have the following two possibilities.

First case:

The first digit is 2, and the last digit is 3. The digits 0, 2, and 3 can be arranged in the remaining 5 positions in a total of $3^{5}$ ways.

Given the conditions, we will subtract from this the total number of all numbers that do not contain the digit 0 but contain 2 or 3. There are $2^{5}$ such numbers.

Thus, we have $3^{5}-2^{5}=211$ different numbers with the given properties and the first digit 2.

In both the first and last positions, the digit is 3. The digits 0, 2, and 3 can be arranged in the remaining 5 positions in a total of $3^{5}$ ways.

Given the conditions, we will subtract from this the total number of all numbers that do not contain at least one of the digits 0 and 2.

The number of numbers that do not contain 0 but contain the digits 2 or 3 is $2^{5}$.

The number of numbers that do not contain the digit 2 but contain 0 or 3 is also $2^{5}$.

1 point

If we subtract these numbers from $3^{5}$, we have subtracted the number with 7 threes twice, so we need to add the number 1 to the total.

Thus, we have $3^{5}-2 \cdot 2^{5}+1=243-64+1=180$ different numbers with the given properties and the first digit 3.

Finally, the total number of numbers with the given properties is

$$
3^{5}-2^{5}+3^{5}-2 \cdot 2^{5}+1=2 \cdot 3^{5}-3 \cdot 2^{5}+1=211+180=391
$$