5.1. Let's consider the number 616. The sum of its digits is 13, and the product of its digits is 36. What is the largest natural number whose sum of digits is 13 and the product of its digits is 36?
Answer: 3322111

Solution. In the decimal representation of this number, there cannot be any zeros. Let's list all the digits of this number that are greater than 1; their product is still 36. Since 36 can be factored into prime factors as $36=2 \cdot 2 \cdot 3 \cdot 3$, the possible sets of digits greater than 1 are: $\{2,2,3,3\},\{2,2,9\},\{2,3,6\},\{3,3,4\}$, $\{4,9\},\{6,6\}$. Since the sum of the digits is 13, the number of ones can be uniquely determined in each case, resulting in the possible sets of digits: $\{1,1,1,2,2,3,3\},\{2,2,9\},\{1,1,2,3,6\},\{1,1,1,3,3,4\},\{4,9\}$, $\{1,6,6\}$. We see that the largest number can be a seven-digit number, and this is only possible in the first case. It remains to note that the largest number with the set of digits $\{1,1,1,2,2,3,3\}$ is the number 3322111.