## Task 2 - 330522

Rolf is looking for four-digit numbers in which no two digits are the same. The difference between the tens and the hundreds digit should be 3, and the difference between the hundreds and the thousands digit should be 4.

When calculating these differences, the order of the two digits involved should not matter.

How many four-digit numbers of the desired type are there in total?

Explain why there cannot be more than the number you have specified!
The thousands digit of the sought number cannot be 0, as the number would otherwise not be four digits.

If the thousands digit is 1, 2, or 3, the hundreds digit cannot be 4 less, so it must be 4 greater, i.e., 5, 6, or 7, respectively. For the thousands digit 6, 7, 8, or 9, the hundreds digit cannot be 4 greater. Only when the thousands digit is 4 or 5, both the 4 less and 4 greater hundreds digit are possible.

Similarly, for the hundreds digits 0, 1, 2, only the 3 greater tens digit is possible, and for 7, 8, 9, only the 3 less tens digit is possible, while for the hundreds digits 3, 4, 5, 6, both possibilities exist.

Therefore, there are exactly the following possibilities for combining the first three digits of the sought numbers:

$$
158,152,269,263,374,403,485,514,596,625,730,736,841,847,958,952
$$

Since in each of these 16 combinations, exactly three different digits appear, there are always 7 possibilities for the missing units digit. Therefore, the total number of numbers of the desired type is $7 \cdot 16=112$.