The problem is:
Find a set of positive real numbers which sum to 271 and has as large product as possible.
All numbers must be , otherwise the product would be zero.
A candidate could be [200, 71]. Could we do better? Yes. Let’s prove that an optimal solution must have all numbers equal.
Assume the sequence is . Without losing generality, we can require that it is sorted such that for , because rearranging the sequence does not affect the sum nor the product.
Assume we have a valid candidate . Build a new sequence which is but with the first (smallest) and last (largest) element replaced with their mean . The sum will be unchanged. The product will be:
The product will be greater than if
This can be simplified to
which is true for positive fulfilling .
That means any candidate which has non-equal elements, can be replaced with having a strictly higher product. Thefore, the optimal solution must have all elements equal.
The problem boils down to selecting the number of terms with equal elements such that the product
is maximized.
The derivative of this with respect to is
which means the maximum occurs at
Since must be integral, we investigate for and and find that gives a slightly higher answer.