68 lines
1.3 KiB
Markdown
68 lines
1.3 KiB
Markdown
---
|
|
id: 5900f5231000cf542c510034
|
|
challengeType: 5
|
|
title: 'Problem 438: Integer part of polynomial equation''s solutions'
|
|
---
|
|
|
|
## Description
|
|
<section id='description'>
|
|
For an n-tuple of integers t = (a1, ..., an), let (x1, ..., xn) be the solutions of the polynomial equation xn + a1xn-1 + a2xn-2 + ... + an-1x + an = 0.
|
|
|
|
|
|
Consider the following two conditions:
|
|
x1, ..., xn are all real.
|
|
If x1, ..., xn are sorted, ⌊xi⌋ = i for 1 ≤ i ≤ n. (⌊·⌋: floor function.)
|
|
|
|
In the case of n = 4, there are 12 n-tuples of integers which satisfy both conditions.
|
|
We define S(t) as the sum of the absolute values of the integers in t.
|
|
For n = 4 we can verify that ∑S(t) = 2087 for all n-tuples t which satisfy both conditions.
|
|
|
|
|
|
Find ∑S(t) for n = 7.
|
|
</section>
|
|
|
|
## Instructions
|
|
<section id='instructions'>
|
|
|
|
</section>
|
|
|
|
## Tests
|
|
<section id='tests'>
|
|
|
|
```yml
|
|
tests:
|
|
- text: <code>euler438()</code> should return 2046409616809.
|
|
testString: assert.strictEqual(euler438(), 2046409616809, '<code>euler438()</code> should return 2046409616809.');
|
|
|
|
```
|
|
|
|
</section>
|
|
|
|
## Challenge Seed
|
|
<section id='challengeSeed'>
|
|
|
|
<div id='js-seed'>
|
|
|
|
```js
|
|
function euler438() {
|
|
// Good luck!
|
|
return true;
|
|
}
|
|
|
|
euler438();
|
|
```
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</section>
|
|
|
|
## Solution
|
|
<section id='solution'>
|
|
|
|
```js
|
|
// solution required
|
|
```
|
|
</section>
|