## Task 2 - 310712

Determine all four-digit natural numbers that satisfy the following conditions (1) and (2)!

(1) The number contains no other digits than 0, 1, and 4, but each of these three digits at least once.

(2) The number is divisible by 18.
If a four-digit natural number satisfies conditions (1) and (2), then:

According to (2), the number is divisible by 18, and thus also by 9; therefore, its digit sum is divisible by 9. According to (1), the digits 0 and 1 each appear at least once, so the digit 4 can appear at most twice. Thus, the digit sum is greater than zero but not greater than \(0 + 1 + 4 + 4 = 9\); hence, it must be equal to 9.

Therefore, condition (1) can only be satisfied if the digits include exactly one 0, one 1, and two 4s.

Furthermore, since the number is divisible by 18, it is an even number. Thus, its units digit must be even, i.e., 0 or 4. Additionally, (as with any four-digit number) the thousands digit must be different from 0.

Given the remaining possibilities for the order of the digits, the number must be one of the numbers 1044, 4014, 1404, 4104, 1440, 4140, 4410 (3).

Indeed, the numbers (3) satisfy condition (1), and they also satisfy (2) because they have a digit sum of 9 and an even units digit, making them divisible by 9 and 2.