Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-443-gcd-sequence.english.md
Oliver Eyton-Williams bd68b70f3d Feat: hide blocks not challenges (#39504)
* fix: remove isHidden flag from frontmatter

* fix: add isUpcomingChange

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>

* feat: hide blocks not challenges

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>
2020-09-03 15:07:40 -07:00

976 B

id, challengeType, title, forumTopicId
id challengeType title forumTopicId
5900f5271000cf542c51003a 5 Problem 443: GCD sequence 302115

Description

Let g(n) be a sequence defined as follows: g(4) = 13, g(n) = g(n-1) + gcd(n, g(n-1)) for n > 4.

The first few values are:

n 4567891011121314151617181920... g(n) 1314161718272829303132333451545560...

You are given that g(1 000) = 2524 and g(1 000 000) = 2624152.

Find g(1015).

Instructions

Tests

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

Challenge Seed

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

euler443();

Solution

// solution required