* fix: clean-up Project Euler 361-380 * fix: improve wording Co-authored-by: Sem Bauke <46919888+Sembauke@users.noreply.github.com> * fix: remove unnecessary paragraph * fix: corrections from review Co-authored-by: Tom <20648924+moT01@users.noreply.github.com> Co-authored-by: Sem Bauke <46919888+Sembauke@users.noreply.github.com> Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
50 lines
983 B
Markdown
50 lines
983 B
Markdown
---
|
|
id: 5900f4e41000cf542c50fff5
|
|
title: 'Problem 375: Minimum of subsequences'
|
|
challengeType: 5
|
|
forumTopicId: 302037
|
|
dashedName: problem-375-minimum-of-subsequences
|
|
---
|
|
|
|
# --description--
|
|
|
|
Let $S_n$ be an integer sequence produced with the following pseudo-random number generator:
|
|
|
|
$$\begin{align}
|
|
S_0 & = 290\\,797 \\\\
|
|
S_{n + 1} & = {S_n}^2\bmod 50\\,515\\,093
|
|
\end{align}$$
|
|
|
|
Let $A(i, j)$ be the minimum of the numbers $S_i, S_{i + 1}, \ldots, S_j$ for $i ≤ j$. Let $M(N) = \sum A(i, j)$ for $1 ≤ i ≤ j ≤ N$.
|
|
|
|
We can verify that $M(10) = 432\\,256\\,955$ and $M(10\\,000) = 3\\,264\\,567\\,774\\,119$.
|
|
|
|
Find $M(2\\,000\\,000\\,000)$.
|
|
|
|
# --hints--
|
|
|
|
`minimumOfSubsequences()` should return `7435327983715286000`.
|
|
|
|
```js
|
|
assert.strictEqual(minimumOfSubsequences(), 7435327983715286000);
|
|
```
|
|
|
|
# --seed--
|
|
|
|
## --seed-contents--
|
|
|
|
```js
|
|
function minimumOfSubsequences() {
|
|
|
|
return true;
|
|
}
|
|
|
|
minimumOfSubsequences();
|
|
```
|
|
|
|
# --solutions--
|
|
|
|
```js
|
|
// solution required
|
|
```
|