data/problems/297.yml
---
:id: 297
:name: Zeckendorf Representation
:url: https://projecteuler.net/problem=297
:content: "Each new term in the Fibonacci sequence is generated by adding the previous
two terms. \nStarting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8,
13, 21, 34, 55, 89.\n\nEvery positive integer can be uniquely written as a sum of
nonconsecutive terms of the Fibonacci sequence. For example, 100 = 3 + 8 + 89. \nSuch
a sum is called the **Zeckendorf representation** of the number.\n\nFor any integer
<var>n</var>\\>0, let <var>z</var>(<var>n</var>) be the number of terms in the Zeckendorf
representation of <var>n</var>. \nThus, <var>z</var>(5) = 1, <var>z</var>(14) = 2,
<var>z</var>(100) = 3 etc. \nAlso, for 0\\<<var>n</var>\\<10<sup>6</sup>, ∑ <var>z</var>(<var>n</var>) = 7894453.\n\nFind
∑ <var>z</var>(<var>n</var>) for 0\\<<var>n</var>\\<10<sup>17</sup>.\n\n"