3. How many natural numbers have a product of digits of 12, a sum of digits of 12, and are divisible by 12? Determine the largest such number.
## Solution.

Let's write the number 12 as a product of single-digit numbers greater than $1: 12=6 \cdot 2=4 \cdot 3=3 \cdot 2 \cdot 2$.

Since the sum of the digits must be 12, there are three possibilities for the digits of such a number:

- $6,2,1,1,1,1$
- $4,3,1,1,1,1,1$
- $3,2,2,1,1,1,1,1$.

A number whose sum of digits is 12 is divisible by 3. We also need to ensure that the number is divisible by 4, so we will specifically examine the last two digits of the number.

In the first case, the last two digits can be 12 or 16 (numbers ending in 26 or 62 are not divisible by 4), so there are two possibilities. Of the remaining four digits, three are 1 and one is 2 or 6, so there are four possibilities for their order (the digit 2 or 6 can be placed in any of the first four decimal places). In total, there are 8 such numbers.

In the second case, the only even digit is 4, so it must be the units digit. However, the two-digit endings 14 and 34 are not divisible by 4. In this case, there are no numbers that meet the given conditions.

In the third case, the units digit must be 2, and the last two digits can be 12 or 32 (it cannot be 22).

If the last two digits are 12, the first six decimal places need to arrange the digits 3, 2, 1, 1, 1, 1. The digits 3 and 2 can be arranged in $6 \cdot 5=30$ ways, and the remaining places are filled with 1.

If the last two digits are 32, the first six places need to arrange the digits 2, 1, 1, 1, 1, 1. This can be done in six ways.

In the third case, there are $30+6=36$ such numbers.

Finally, there are a total of $8+36=44$ such numbers. The largest such number is 32111112.

Note. These numbers are:

$111612,116112,161112,611112,111216,112116,121116,211116$,

$11112312,11113212,11121312,11123112,11131212,11132112$,

$11211312,11213112,11231112,11311212,11312112,11321112$,

$12111312,12113112,12131112,12311112,13111212,13112112$, $13121112,13211112,21111312,21113112,21131112,21311112$, $23111112,31111212,31112112,31121112,31211112,32111112$, 21111132, 12111132,11211132,11121132,11112132 and 11111232.