freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-190-maximising-a-we...

853 B

id title challengeType forumTopicId dashedName
5900f42b1000cf542c50ff3d Problem 190: Maximising a weighted product 5 301828 problem-190-maximising-a-weighted-product

--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 maximised.

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

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

--hints--

maximisingWeightedProduct() should return 371048281.

assert.strictEqual(maximisingWeightedProduct(), 371048281);

--seed--

--seed-contents--

function maximisingWeightedProduct() {

  return true;
}

maximisingWeightedProduct();

--solutions--

// solution required