Smallest number such that the sum of digits and the product of digits is $2000$

contest-mathelementary-number-theoryrecreational-mathematics

Find the smallest number such that the sum of the digits and the product of the digits is $2000$.

I came across the following question on the internet and I am unable to solve this.

Which mathematical tools are used to solve such kind of questions? Can anyone please explain in detail?

Best Answer

Hint: The prime factorization of $2000$ is $2^4\cdot 5^3$

This implies that among the possible digits in our number, we could have any number of $1$'s, we must have exactly three $5$'s, and we must have either four $2$'s or two $2$'s and a $4$ or one $2$ and an $8$ or two $4$'s.

Taking note of the possibilities remaining due to the restriction on the product of the digits being what they are, we then try to use the fewest number of digits and have the smallest leading string of digits possible.

We use a $2$ and an $8$ rather than the other options for how to distribute the factors of two as this leaves us with our factors of two only occupying two slots and leaves us with a smallest possible leading digit

Arranging the digits then our final number is:

$\underbrace{11111\cdots 11}_{1975~\text{ones}}25558$