# [seqfan] Re: Maximizing product for a fixed sum n

Jack Grahl jack.grahl at gmail.com
Mon Oct 19 10:25:46 CEST 2020

```Thanks Oscar. In my version of the problem the numbers need not be natural.
So the best result for sum=5 is 2.5^2 > 2*3.

For larger n the number of pieces is roughly n/e, whereas in the case of
natural numbers only, the number of pieces is roughly n/3.

On Mon, 19 Oct 2020, 09:21 Oscar Cunningham, <mail at oscarcunningham.com>
wrote:

> This is a somewhat famous problem. The solution is given here:
> https://math.stackexchange.com/q/125065/1149
>
> You should pick all the ai to be equal to 3, except for one or two of
> them which should be equal to 2 in order that they sum to the right
> value modulo 3. Of course you can use a 4 instead of two 2s.
>
> This sequence gives the optimal product for each n:
> https://oeis.org/A000792
>
> Best regards,
>
> Oscar
>
> On 18/10/2020 10:31, Jack Grahl wrote:
> > Dear all,
> >
> > Suppose I wish to find some set of positive numbers a1,a2...,ak such that
> > their sum is n, and their product is as large as possible. Clearly, if I
> > fix the cardinality k, the optimal solution is k copies of n/k. What is
> the
> > best choice of k? In other words, what is the natural number k which
> > maximises (n/k)^k?
> >
> > Calculus shows that, if we replace integer k by real number x, x = n/e is
> > optimal, and hence than either k = floor(n/e) or k = ceil(n/e) is the
> > optimal integer solution, with the choice of floor and ceiling possibly
> > depending on n.
> >
> > Experimentation shows that in fact the best k is the closest integer to
> n/e
> > for all 2 <= n <= 1000. (n = 4 is slightly exceptional, as the closest
> > integer to 4/e is 1, but there is a tie between 1 and 2 for the optimal
> > value of k, using the well known result that 2*2 = 4.)
> >
> > 1. Can anyone show that the closest integer to n/e must always be
> optimal?
> > 2. If so, we could add the sequence 'closest integer to n/e' with a
> remark
> > that it solves the above problem. If not, we could add both sequences,
> with
> > a remark that they are conjectured to be the same.
> >
> > Best wishes,
> > Jack Grahl
> >
> > --
> > Seqfan Mailing list - http://list.seqfan.eu/
>
> --
> Seqfan Mailing list - http://list.seqfan.eu/
>

```