freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/project-euler/problem-137-fibonacci-golde...

1.4 KiB
Raw Blame History

id challengeType title videoUrl localeTitle
5900f3f51000cf542c50ff08 5 Problem 137: Fibonacci golden nuggets 问题137斐波那契金块

Description

考虑无穷多项式系列AFx= xF1 + x2F2 + x3F3 + ...其中Fk是斐波纳契数列中的第k项1,1,2,3,5,8...;也就是说Fk = Fk-1 + Fk-2F1 = 1且F2 = 1.对于这个问题我们将对x的值感兴趣其中AFx是正整数。令人惊讶的是AF1/2=1/2.1 +1/22.1 +1/23.2 +1/24.3 +1/25.5 + ......

= 1/2 + 1/4 + 2/8 + 3/16 + 5/32 + ......

= 2前五个自然数的x的相应值如下所示。

xAFx√2-111/ 22√13-2/ 33√89-5/ 84√34-3/ 55

如果x是理性的我们将AFx称为金块因为它们变得越来越稀少;例如第10个金块是74049690.找到第15个金块。

Instructions

Tests

tests:
  - text: <code>euler137()</code>应该返回1120149658760。
    testString: 'assert.strictEqual(euler137(), 1120149658760, "<code>euler137()</code> should return 1120149658760.");'

Challenge Seed

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

euler137();

Solution

// solution required