2021-06-15 00:49:18 -07:00
---
id: 5900f4951000cf542c50ffa8
2022-03-01 21:39:26 +05:30
title: 'Problema 297: rappresentazione di Zeckendorf'
2021-06-15 00:49:18 -07:00
challengeType: 5
forumTopicId: 301949
dashedName: problem-297-zeckendorf-representation
---
# --description--
2022-03-01 21:39:26 +05:30
Ogni nuovo termine della sequenza di Fibonacci è dato dalla somma dei due numeri precedenti.
2021-06-15 00:49:18 -07:00
2022-03-01 21:39:26 +05:30
Iniziando con 1 e 2, i primi 10 termini saranno: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89.
2021-06-15 00:49:18 -07:00
2022-03-01 21:39:26 +05:30
Ogni numero intero positivo può essere scritto in maniera unica come somma di termini non consecutivi della sequenza di Fibonacci. Ad esempio, 100 = 3 + 8 + 89.
2021-06-15 00:49:18 -07:00
2022-03-01 21:39:26 +05:30
Tale somma è chiamata la rappresentazione Zeckendorf del numero.
2021-06-15 00:49:18 -07:00
2022-03-01 21:39:26 +05:30
Per qualsiasi numero intero $n>0$, sia $z(n)$ il numero di termini nella rappresentazione di Zeckendorf di $n$.
Così, $z(5) = 1$, $z(14) = 2$, $z(100) = 3$ ecc.
Inoltre, per $0 < n < {10}^6$, $\sum z(n) = 7\\,894\\,453$.
Trova $\sum z(n)$ per $0 < n < {10}^{17}$.
2021-06-15 00:49:18 -07:00
# --hints--
2022-03-01 21:39:26 +05:30
`zeckendorfRepresentation()` dovrebbe restituire `2252639041804718000` .
2021-06-15 00:49:18 -07:00
```js
2022-03-01 21:39:26 +05:30
assert.strictEqual(zeckendorfRepresentation(), 2252639041804718000);
2021-06-15 00:49:18 -07:00
```
# --seed--
## --seed-contents--
```js
2022-03-01 21:39:26 +05:30
function zeckendorfRepresentation() {
2021-06-15 00:49:18 -07:00
return true;
}
2022-03-01 21:39:26 +05:30
zeckendorfRepresentation();
2021-06-15 00:49:18 -07:00
```
# --solutions--
```js
// solution required
```