I essentially have a problem which boils down to the following: Given some (integer) number n, find a set of coprime numbers, say c = (c1, c2, ..., ck), each less than n, which satisfy:
1) The product of all ci is maximal.
2) The sum of all ci is equal to n.
This may end up being a question for MathOverflow, but is there any kind of non-brute force algorithm for doing this?
You're basically looking for the maximal least common multiple of any partition of n. The product is known as Landau's function (see OEIS A000793). This can be computed using dynamic programming, see here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With