Problem:
Decompose the natural number $n$ into a sum of natural numbers so that the product of the summands is maximum.
Solution:
We go further and give explicitly the maximum product. Let $n=a_1+a_2+\ldots+a_m$ and $P=a_1a_2\cdots a_m$, where $a_i \in \mathbb{N}^*$ for every $1 \leq i \leq m$ . If $n=1,2$, clearly $P_{\max}=1$. Assume $n > 2$. To maximize $P$, any number $a_i$ can't be $1$ since $a_i + 1 > a_i \cdot 1$ for every $1 \leq i \leq m$ and we can replace the two summands $a_i$ and $1$ with $a_i + 1$. Likewise, if $a_i > 4$, we can replace $a_i$ with $(a_i-2)+2$ since $2(a_i-2) > a_i$. At last, we observe that it's indifferent to have $4$ or $2+2$, so $P$ can be maximized with $2$'s and $3$'s. Since $3^2 > 2^3$, we can have at most two summands equal to $2$ since we can replace $2+2+2$ with $3+3$. To be more precise, we have $$P_{max} = \left\{ \begin{array}{lll} 3^k & \textrm{if } n=3k \\ 2^2 \cdot 3^{k-1} & \textrm{if } n=3k+1 \\ 2\cdot 3^k & \textrm{if } n=3k+2 \end{array} \right.$$ where $k \in \mathbb{N}^*$.
No comments:
Post a Comment