Files
freeCodeCamp/curriculum/challenges/japanese/10-coding-interview-prep/project-euler/problem-297-zeckendorf-representation.md
2022-01-23 00:08:20 +09:00

1.3 KiB

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
5900f4951000cf542c50ffa8 問題 297: ゼッケンドルフ表現 5 301949 problem-297-zeckendorf-representation

--description--

フィボナッチ数列の新しい項はそれぞれ、前の 2 項を足すことによって得られます。

1 と 2 から始まる最初の 10 項は 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 です。

すべての正の整数は、フィボナッチ数列の非連続項の和として一意に表すことができます。 例えば、100 = 3 + 8 + 89です。

このような和は、数のゼッケンドルフ表現と呼ばれます。

任意の整数 n>0 について、n のゼッケンドルフ表現における項数を z(n) とします。

すなわち、z(5) = 1, z(14) = 2, z(100) = 3 などです。

また、0 < < {10}^6 のとき、\sum z(n) = 7\\,894\\,453 です。

0 < n < {10}^{17} のとき、\sum z(n) を求めなさい。

--hints--

zeckendorfRepresentation()2252639041804718000 を返す必要があります。

assert.strictEqual(zeckendorfRepresentation(), 2252639041804718000);

--seed--

--seed-contents--

function zeckendorfRepresentation() {

  return true;
}

zeckendorfRepresentation();

--solutions--

// solution required