4. Equality

$$
2008=1111+666+99+88+44
$$

is a decomposition of the number 2008 into the sum of several mutually distinct multi-digit numbers, each of which is written with the same digits. Find

a) at least one such decomposition of the number 8002,

b) all such decompositions of the number 8002 that have the smallest number of addends (the order of the addends is not considered).

(Jaromír Šimša)
Solution. a) An example of the desired decomposition is the equality

$$
8002=3333+999+888+777+666+555+333+99+88+77+66+55+44+22 .
$$

In the second part, we will show that this is the only decomposition of the number 8002 into 14 addends and that no such decomposition into fewer addends exists.

b) A number of the form $\overline{a a a a}$, resp. $\overline{a a a}$, resp. $\overline{a a}$ is an $a$-multiple of the number 1111, resp. 111, resp. 11. Therefore, every considered decomposition of the number 8002 can be written, after partial summation (of "same-place" addends), in the form

$$
8002=1111 k+111 l+11 m,
$$

where $k, l, m$ are non-negative integers not exceeding the value of the sum $1+2+\ldots+9=45$ (since the "same-place" addends must be distinct).

We rewrite the given equation as

$$
\begin{gathered}
8002=727 \cdot 11+5=11(101 k+10 l+m)+l, \\
727=101 k+10 l+m+\frac{l-5}{11} .
\end{gathered}
$$

From this, it follows (considering $l \leqq 45$), that $l=11 q+5$, where $q \in\{0,1,2,3\}$. We then obtain the equation

$$
677=101 \cdot 6+71=101(k+q)+10 q+m
$$

from which it is clear that $k+q=6$ and $10 q+m=71$. This system has a unique solution under the given conditions: $q=3, k=3$, and $m=41$. For $l$, we get $l=38$.

To create the desired decomposition, it remains to decompose the found numbers $k, l, m$ into the sum of one or several different single-digit addends. Given that we have exactly nine addends $9+8+7+6+5+4+3+2+1$ with a sum of 45, it will likely be simpler to list the decompositions for $k, 45-l$, and $45-m$ (the decompositions of $l$ and $m$ will then be obtained by omitting the found addends from the sum $1+2+\ldots+9$):

$$
\begin{gathered}
k=3=1+2, \\
45-l=7=1+6=1+2+4=2+5=3+4, \\
45-m=4=1+3 .
\end{gathered}
$$

We have found all $2 \cdot 5 \cdot 2$ possible decompositions of the number 8002 that have the required properties, each of which has at least $1+6+7=14$ addends, and the decomposition into 14 addends is unique and was given in the solution to part a).