Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-297-zeckendorf-representation.md
Oliver Eyton-Williams ee1e8abd87 feat(curriculum): restore seed + solution to Chinese (#40683)
* feat(tools): add seed/solution restore script

* chore(curriculum): remove empty sections' markers

* chore(curriculum): add seed + solution to Chinese

* chore: remove old formatter

* fix: update getChallenges

parse translated challenges separately, without reference to the source

* chore(curriculum): add dashedName to English

* chore(curriculum): add dashedName to Chinese

* refactor: remove unused challenge property 'name'

* fix: relax dashedName requirement

* fix: stray tag

Remove stray `pre` tag from challenge file.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2021-01-12 19:31:00 -07:00

47 lines
1.0 KiB
Markdown

---
id: 5900f4951000cf542c50ffa8
title: 'Problem 297: Zeckendorf Representation'
challengeType: 5
forumTopicId: 301949
dashedName: problem-297-zeckendorf-representation
---
# --description--
Each new term in the Fibonacci sequence is generated by adding the previous two terms.
Starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89.
Every positive integer can be uniquely written as a sum of nonconsecutive terms of the Fibonacci sequence. For example, 100 = 3 + 8 + 89. Such a sum is called the Zeckendorf representation of the number.
For any integer n>0, let z(n) be the number of terms in the Zeckendorf representation of n. Thus, z(5) = 1, z(14) = 2, z(100) = 3 etc. Also, for 0&lt;n&lt;106, ∑ z(n) = 7894453.
Find ∑ z(n) for 0&lt;n&lt;1017.
# --hints--
`euler297()` should return 2252639041804718000.
```js
assert.strictEqual(euler297(), 2252639041804718000);
```
# --seed--
## --seed-contents--
```js
function euler297() {
return true;
}
euler297();
```
# --solutions--
```js
// solution required
```