## Task B-4.4.

The digits of the nine-digit number are mutually different and different from 0. Any two adjacent digits form a two-digit number that is divisible by 7 or 13. Determine that nine-digit number.
## Solution.

The digits of the nine-digit number are $a, b, c, d, e, f, g, h, i \in\{1,2, \ldots, 9\}$ in some order.

Two-digit numbers $a b, b c, c d, d e, e f, f g, g h, h i$ must be divisible by 7 or 13.

Two-digit numbers that are divisible by 7 are: $14,21,28,35,42,49,56,63,70,77$, 84, 91,98.

Two-digit numbers that are divisible by 13 are: $39,52,65,78,91$.

Numbers 70 and 77 cannot appear among the digits of the given number because all digits must be different and different from 0. The digit 7 must appear once, and since no other remaining number ends with the digit 7, the number 78 must be at the beginning.

It follows: 784 (84 is the only one that starts with 8), i.e., 7842 or 7849.

In the case where the number starts with 7842, the next digit is 1 or 6, i.e., 78421 or 78426. Let's examine each of these possibilities:

$$
\begin{array}{rlrl}
78421 & \rightarrow 7842135 & \rightarrow 78421356 \rightarrow \text { not possible } & \\
& \rightarrow 7842139 \rightarrow \text { not possible } & & 1 \text { point } \\
78426 & \rightarrow 784263 \rightarrow 7842635 \rightarrow \text { not possible } & & \\
& \rightarrow 784265 \rightarrow \text { not possible. } & 1 \text { point }
\end{array}
$$

For each of the possibilities where it says "not possible," the digits start repeating at some point.

The only remaining case to check is when the number starts with 7849:

$$
\begin{aligned}
7849 \rightarrow 78491 \rightarrow 784913 \rightarrow 7849135 & \rightarrow 78491352 \rightarrow 784913526 \\
& \rightarrow 78491355 \rightarrow \text { not possible }
\end{aligned}
$$

Thus, the only possible number is 784913526.