2018-09-30 22:01:58 +00:00
|
|
|
|
---
|
|
|
|
|
id: 5900f4e41000cf542c50fff5
|
|
|
|
|
challengeType: 5
|
|
|
|
|
title: 'Problem 375: Minimum of subsequences'
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Description
|
|
|
|
|
<section id='description'>
|
|
|
|
|
Let Sn be an integer sequence produced with the following pseudo-random number generator:
|
|
|
|
|
S0
|
|
|
|
|
=
|
|
|
|
|
290797
|
|
|
|
|
Sn+1
|
|
|
|
|
=
|
|
|
|
|
Sn2 mod 50515093
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Let A(i, j) be the minimum of the numbers Si, Si+1, ... , Sj for i ≤ j.
|
|
|
|
|
Let M(N) = ΣA(i, j) for 1 ≤ i ≤ j ≤ N.
|
|
|
|
|
We can verify that M(10) = 432256955 and M(10 000) = 3264567774119.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Find M(2 000 000 000).
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Instructions
|
|
|
|
|
<section id='instructions'>
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
|
|
```yml
|
2018-10-04 13:37:37 +00:00
|
|
|
|
tests:
|
|
|
|
|
- text: <code>euler375()</code> should return 7435327983715286000.
|
2018-10-20 18:02:47 +00:00
|
|
|
|
testString: assert.strictEqual(euler375(), 7435327983715286000, '<code>euler375()</code> should return 7435327983715286000.');
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Challenge Seed
|
|
|
|
|
<section id='challengeSeed'>
|
|
|
|
|
|
|
|
|
|
<div id='js-seed'>
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
function euler375() {
|
|
|
|
|
// Good luck!
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
euler375();
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Solution
|
|
|
|
|
<section id='solution'>
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
// solution required
|
|
|
|
|
```
|
|
|
|
|
</section>
|