Files
freeCodeCamp/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-375-minimum-of-subsequences.english.md
Oliver Eyton-Williams f1c9b08cf3 fix(curriculum): add isHidden: false to challenges
This includes certificates (where it does nothing), but does not
include any translations.
2020-05-25 16:25:19 +05:30

1.0 KiB

id, challengeType, isHidden, title, forumTopicId
id challengeType isHidden title forumTopicId
5900f4e41000cf542c50fff5 5 false Problem 375: Minimum of subsequences 302037

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

Instructions

Tests

tests:
  - text: <code>euler375()</code> should return 7435327983715286000.
    testString: assert.strictEqual(euler375(), 7435327983715286000);

Challenge Seed

function euler375() {
  // Good luck!
  return true;
}

euler375();

Solution

// solution required