Valeriy 79d9012432 fix(curriculum): quotes in tests (#18828)
* fix(curriculum): tests quotes

* fix(curriculum): fill seed-teardown

* fix(curriculum): fix tests and remove unneeded seed-teardown
2018-10-20 23:32:47 +05:30

993 B

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

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:

n4567891011121314151617181920...
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, '<code>euler443()</code> should return 2744233049300770.');

Challenge Seed

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

euler443();

Solution

// solution required