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?

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$.
