Back to Freecodecamp

Problem 190: Maximizing a weighted product

curriculum/challenges/english/blocks/project-euler-problems-101-to-200/5900f42b1000cf542c50ff3d.md

latest670 B
Original Source

--description--

Let $S_m = (x_1, x_2, \ldots, x_m)$ be the $m$-tuple of positive real numbers with $x_1 + x_2 + \cdots + x_m = m$ for which $P_m = x_1 \times {x_2}^2 \times \cdots \times {x_m}^m$ is maximized.

For example, it can be verified that $[P_{10}] = 4112$ ([ ] is the integer part function).

Find $\sum {[P_m]}$ for $2 ≤ m ≤ 15$.

--hints--

maximizingWeightedProduct() should return 371048281.

js
assert.strictEqual(maximizingWeightedProduct(), 371048281);

--seed--

--seed-contents--

js
function maximizingWeightedProduct() {

  return true;
}

maximizingWeightedProduct();

--solutions--

js
// solution required