4. Determine the largest natural number $n$ for which there exists an $n$-digit number $\overline{z_{1} z_{2} \ldots z_{n}}$ (in the decimal system) with the following properties:

(a) $z_{1}, z_{2}, \ldots, z_{n}$ are distinct numbers;

(b) for every $j \leq n, (1 \cdot 2 \cdot 3 \cdot \ldots \cdot j) \mid \overline{z_{1} z_{2} \ldots z_{j}}$.

For that $n$, find all $n$-digit numbers $\mathrm{s}$ with the desired properties.
4. Because $1 \cdot 2 \cdot \ldots \cdot j \mid \overline{z_{1} z_{2} \ldots z_{j}}$, for every $j \geq 2$, all digits $z_{2}, z_{3}, \ldots, z_{n}$ must be even. Condition (a) implies $n \leq 6$. Because $1 \cdot 2 \cdot \ldots \cdot j \mid \overline{z_{1} z_{2} \ldots z_{j}}$ for every $j \geq 3$, it must be

$$
\begin{aligned}
& z_{1}+z_{2}+z_{3} \equiv 0 \quad(\bmod 3) \\
& z_{j} \equiv 0 \quad(\bmod 3) \quad \text { for } j \geq 4
\end{aligned}
$$

Condition (a) implies $n \leq 5$, because the only possible digits for $z_{4}$ and $z_{5}$ are 0 and 6. Similarly, because

$$
1 \cdot 2 \cdot \ldots \cdot j \mid \overline{z_{1} z_{2} \ldots z_{j}} \text {, for every } j \geq 4 \text {, } 10 z_{3}+z_{4} \equiv 0(\bmod 4)
$$

But, $z_{3}$ and $z_{4}$ must be divisible by $2, z_{3}$ is 3, so the only possibility is

$z_{4}=0\left(z_{4}=6\right.$ is not possible because $4 \mid\left(10 z_{3}+z_{4}\right)$ and $\left.z_{3} \equiv 0(\bmod 4)\right)$.

Furthermore, $2\left|z_{5}, 3\right| z_{5}, 4 \mid\left(10 z_{4}+z_{5}\right)$, i.e., $4 \mid z_{5}$ and $5 \mid z_{5}$. The only solution is

$z_{5}=0$, and since the digits must be different, we get $n=4. \quad 5$ points Thus, $n=4, z_{4}=0, z_{3} \equiv 0(\bmod 4), 2\left|z_{2}, 3\right|\left(z_{1}+z_{2}+z_{3}\right) \text{ and }$

$z_{1} \neq z_{2} \neq z_{3} \neq z_{1}$. The desired numbers are:

| 3240 | 5640 | 9840 | 9480 |
| :--- | :--- | :--- | :--- |
| 6240 | 8640 | 5280 | 1680 |
| 9240 | 3840 | 3480 | 4680 |
| 2640 | 6840 | 6480 | 7680 |

In total, there are 16 numbers.

5 points

## MINISTRY OF EDUCATION AND SPORT OF THE REPUBLIC OF CROATIA

CROATIAN MATHEMATICAL SOCIETY

## MATHEMATICS