I have been given a positive integer $B$. How can I find a positive integer $k$ and positive integers $n_1,n_2,\ldots,n_k$ such that $\sum_{i=1}^k n_i=B$ and $\prod_{i=1}^k n_i$ is as large as possible. I think this has something to do with arithmetic-geometric inequality but it is not straightforward as $n_i$ must be integers. I also think that the result is of the form $$n_1=n_2=\ldots =n_l=n_{l+1}+1=n_{l+2}+1=\ldots =n_k+1$$.
Asked
Active
Viewed 603 times
1 Answers
1
Suppose you have two of your integers at a distance of at least $2$ from one another, e.g. $n_2=n_1+M, M\ge2$. Then
$$(n_1+1)(n_2-1)=(n_1+1)(n_1+(M-1))=n_1^2+Mn_1+(M-1) > n_1^2+Mn_1=(n_1)(n_1+M)=n_1n_2$$
So, if the gap between any two of your integers is $\ge2$, you can increase the smaller integer by $1$, decrease the larger integer by $1$. This keeps the sum the same and increases the product, as shown above.
Thus, any product-maximising solution will have no two of the integers at a distance of $\ge2$ between them, i.e. will (under suitable permutation) have the form $n_1=n_2=\ldots =n_l=n_{l+1}+1=n_{l+2}+1=\ldots =n_k+1$
πr8
- 10,800
-
Thank you very much! That helps but is not a complete answer. For example how one chooses the variable $k$? – student Feb 14 '16 at 12:19
-
1I'll think about it, though I think that it should depend quite a bit on $B$. Choosing $k$ even takes some work when the $n_i$ don't have to be integers, and I suspect it'll be even tougher here. Note that for $B=4$ (amongst others), the maximal solutions are $4$ and $2\times2$, so solutions need not be unique. – πr8 Feb 14 '16 at 12:23