freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/project-euler/problem-443-gcd-sequence.ch...

980 B
Raw Blame History

id challengeType title videoUrl localeTitle
5900f5271000cf542c51003a 5 Problem 443: GCD sequence

Description

设gn为如下定义的序列g4= 13gn= gn-1+ gcdngn-1n> 4。

前几个值是:

 n4567891011121314151617181920... g(n)1314161718272829303132333451545560... 

给出g1 000= 2524和g1 000 000= 2624152。

找到g1015

Instructions

undefined

Tests

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

Challenge Seed

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

euler443();

Solution

// solution required