freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-258-a-lagged-fibonacci-sequence.english.md
mrugesh 22afc2a0ca feat(learn): python certification projects (#38216)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com>
Co-authored-by: Beau Carnes <beaucarnes@gmail.com>
2020-05-27 13:19:08 +05:30

812 B

id, challengeType, isHidden, title, forumTopicId
id challengeType isHidden title forumTopicId
5900f46e1000cf542c50ff81 5 false Problem 258: A lagged Fibonacci sequence 301906

Description

A sequence is defined as:

gk = 1, for 0 ≤ k ≤ 1999 gk = gk-2000 + gk-1999, for k ≥ 2000. Find gk mod 20092010 for k = 1018.

Instructions

Tests

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

Challenge Seed

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

euler258();

Solution

// solution required