How come, in this problem, the maximum product is always achieved using only $2$s and $3$s? Consider the following problem.
Given a number $N$, write it as a sum $n = n_1 + n_2 + \cdots + n_k$, such that the product $p = n_1 \times n_2 \times \cdots \times n_k$ is maximized.
For example, $11$ can be written as $2 + 3 + 3 + 3$ or as $7 + 4$, yielding the products $2 \times 3 \times 3 \times 3 = 54$ and $7 \times 4 = 28$.
So in this case, the answer is is $2\times 3\times 3\times 3$.
For $17$ we have the same situation: $2 \times 3 \times 3 \times 3 \times 3 \times 3 = 486$.
So my question is, why is the maximum product always achieved by using only $2$s and $3$s?
 A: Any factor $1$ can be merged with some other factor, and the product will get larger. When $n>4$ then $(n-3)\cdot 3>n$, furthermore $4=2\cdot2$. Therefore the largest possible product can be written with $3$s and $2$s only. 
As $2\cdot 2\cdot 2<3\cdot 3$ it is advantageous to replace three $2$s by two $3$s as often as possible. At the end there remain only $3$s and zero, one, or two $2$s, depending on the remainder of the given $n$ modulo $3$.
A: For every sequence of natural numbers $\{a_1,\dots,a_n\}$ such that $N=\sum\limits_{k=1}^{n}a_k$:


*

*If $a_k=4$, then you can get an equivalent value by decomposing it into $2+2$ since $2\cdot2=4$

*If $a_k=5$, then you can get a better value by decomposing it into $2+3$ since $2\cdot3=6>5$

*If $a_k=6$, then you can get a better value by decomposing it into $3+3$ since $3\cdot3=9>6$

*If $a_k>6$, then you can get a better value by decomposing it into one of the previous values

In addition to that, you can get a better value by replacing every triplet $\{2,2,2\}$ with a pair $\{3,3\}$:


*

*$2+2+2=6=3+3$

*$2\cdot2\cdot2=8<9=3\cdot3$



Hence the best decomposition is into a list of $2$s and $3$s, with at most two $2$s.
