## Task 3A - 301233A

Determine all seventeen-digit natural numbers $n$ whose 17 digits $x_{1}, x_{2}, \ldots, x_{17}$ satisfy the following conditions (1) and (2):

(1) It holds that: $x_{1} \geq x_{2} \geq \ldots \geq x_{17}$.

(2) For the sum $s=x_{1}+x_{2}+\ldots+x_{17}$ and the product $p=x_{1} \cdot x_{2} \cdot \ldots \cdot x_{17}$, it holds that: $s=p$.

Hint: The order $x_{1}, \ldots, x_{17}$ corresponds to the usual notation; thus, $x_{17}$ denotes the units digit, $x_{16}$ the tens digit, and so on.
We first try to narrow down the conditions for the digits $x_{1}, x_{2}, \ldots, x_{17}$ a bit more:

1. Since $x_{1}>0$, it follows that $s>0$ and because $p=s$, none of the 17 digits can be 0. In particular, it must therefore hold that $x_{1} \geq x_{2} \geq 2$, because otherwise $s \geq 17$, but $p \leq 9$ would hold, which would again contradict $p=s$.
2. At most $x_{1}, x_{2} \in\{6,7,8,9\}$ can be true, because otherwise $p \geq 6^{3}=216$, but $s \leq 17 \cdot 9=153$, a contradiction!
3. Because of 2., it already holds that

$$
s \leq 2 \cdot 9+15 \cdot 1=33
$$

since for all 17-tuples $\left(x_{1}, x_{2}, \ldots, x_{17}\right)$, for which $x_{1} x_{2} \ldots x_{17}$ does not exceed a given value $p$ (here $p=153$), the one that has the largest sum value $s=x_{1}+x_{2}+\ldots+x_{17}$ is always the one for which the $x_{i}, i=1,2, \ldots, 17$ are chosen as large as possible in this order with respect to $x_{1} x_{2} \ldots x_{i} \leq p$, which here leads to $x_{1}=x_{2}=9, x_{3}=\ldots=x_{17}=1$ and thus to the above estimate. Therefore, at most the digits $x_{1}, x_{2}, \ldots, x_{5}$ can have a value greater than 1, because otherwise

$$
p \geq 2^{6}=64>s
$$

would hold.

4. But it cannot be that $x_{5}>1$ either, because the only possibility remaining after 3. $\left(x_{1}, x_{2}, x_{3}, x_{4}, x_{5}\right)=(2,2,2,2,2)$ does not lead to a solution, since for it obviously

$$
s=x_{1}+x_{2}+x_{3}+x_{4}+x_{5}+12=240 \\
x_{1}+x_{2}+x_{3}+x_{4} & =x_{1} x_{2} x_{3} x_{4} x_{5}-13 \leq 20
\end{aligned}
$$

are satisfied, where, according to 1., $x_{1} \geq x_{2}>1$ must also hold.

We therefore make the following case distinction:

1. Case: $x_{1}=9$.

Of the 2 possibilities

$$
\left(x_{1}, x_{2}, x_{3}, x_{4}\right) \in\{(9,2,1,1),(9,3,1,1)\}
$$

which are compatible with the above conditions, $\left(x_{1}, x_{2}, x_{3}, x_{4}\right)=(9,3,1,1)$ actually leads to a solution with the further specifications $x_{5}=x_{6}=\ldots=x_{17}=1$.

2. Case: $x_{1}=8$.

The 4 possibilities

$$
\left(x_{1}, x_{2}, x_{3}, x_{4}\right) \in\{(8,2,1,1),(8,2,2,1),(8,3,1,1),(8,4,1,1)\}
$$

all lead to a contradiction with (2) when substituted.

3. Case: $x_{1}=7$

Here, the 4 possibilities

$$
\left(x_{1}, x_{2}, x_{3}, x_{4}\right) \in\{(7,2,1,1),(7,2,2,1),(7,3,1,1),(7,4,1,1)\}
$$

do not yield any further solution.

4. Case: $x_{1}=6$

Here we have the 5 possibilities

$$
\left(x_{1}, x_{2}, x_{3}, x_{4}\right) \in\{(6,2,1,1),(6,2,2,1),(6,3,1,1),(6,4,1,1),(6,5,1,1)\}
$$

of which

$$
x_{1}=6, x_{2}=2, x_{3}=2, x_{4}=\ldots=x_{17}=1
$$

is actually a solution.

5. Case: $x_{1}=5$

Here we have the 6 possibilities

$$
\left(x_{1}, x_{2}, x_{3}, x_{4}\right) \in\{(5,2,1,1),(5,2,2,1),(5,3,1,1),(5,3,2,1),(5,4,1,1),(5,5,1,1)\}
$$

of which

$$
x_{1}=x_{2}=5, x_{3}=\ldots=x_{17}=1
$$

is actually a solution.

Since we can now rule out that in any further solutions the digits 9, 8, 7, 6, 5 occur, it is worth adjusting our bound for $s$. For it, we now have

$$
s \leq 4+4+2+14 \cdot 1=24
$$

On the other hand, the trivial lower bound $s \geq 17$ also holds, which we can sharpen to $s \geq 19$ because of $x_{1} \geq x_{2}>1$. It is actually easier to simply look at all "candidates" for $s=p \in\{19,20,21,22,23,24\}$, of which only those that do not have a prime factor greater than 3 come into question. Thus, only $s=p=24$ remains, which leads to the two possibilities

$$
x_{1}=4, x_{2}=3, x_{3}=2, x_{4}=1 \quad \text { or } \quad x_{1}=3, x_{2}=x_{3}=x_{4}=2
$$

which, however, do not yield any further solution here, as they do not satisfy (2).

In summary, all solutions to the problem are given by the three 17-digit numbers

$9311111111111111, \quad 6221111111111111, \quad 55111111111111111$