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

43 lines
853 B
Markdown
Raw Normal View History

---
id: 5900f42b1000cf542c50ff3d
title: 'Problem 190: Maximising a weighted product'
challengeType: 5
forumTopicId: 301828
dashedName: 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`.
```js
assert.strictEqual(maximisingWeightedProduct(), 371048281);
```
# --seed--
## --seed-contents--
```js
function maximisingWeightedProduct() {
return true;
}
maximisingWeightedProduct();
```
# --solutions--
```js
// solution required
```