2021-06-15 00:49:18 -07:00
---
id: 5900f4151000cf542c50ff28
title: >-
2022-02-28 13:29:21 +05:30
Problema 169: esplorando il numero di modi diversi in cui un numero può essere espresso come somma delle potenze di 2
2021-06-15 00:49:18 -07:00
challengeType: 5
forumTopicId: 301803
dashedName: >-
problem-169-exploring-the-number-of-different-ways-a-number-can-be-expressed-as-a-sum-of-powers-of-2
---
# --description--
2022-02-28 13:29:21 +05:30
Sia $f(0) = 1$ e sia $f(n)$ il numero di modi diversi in cui $n$ può essere espresso come numero di potenze intere di 2 usando ogni potenza non più di due volte.
2021-06-15 00:49:18 -07:00
2022-02-28 13:29:21 +05:30
Per esempio, $f(10)=5$ visto che ci sono cinque modi diversi di esprimere 10:
2021-06-15 00:49:18 -07:00
2022-03-31 22:31:59 +05:30
$$\begin{align} & 1 + 1 + 8 \\\\
& 1 + 1 + 4 + 4 \\\\ & 1 + 1 + 2 + 2 + 4 \\\\
& 2 + 4 + 4 \\\\ & 2 + 8 \end{align}$$
2021-06-15 00:49:18 -07:00
2022-02-28 13:29:21 +05:30
Qual è il valore di $f({10}^{25})$?
2021-06-15 00:49:18 -07:00
# --hints--
2022-02-28 13:29:21 +05:30
`numberOfWaysToExpress()` dovrebbe restituire `178653872807` .
2021-06-15 00:49:18 -07:00
```js
2022-02-28 13:29:21 +05:30
assert.strictEqual(numberOfWaysToExpress(), 178653872807);
2021-06-15 00:49:18 -07:00
```
# --seed--
## --seed-contents--
```js
2022-02-28 13:29:21 +05:30
function numberOfWaysToExpress() {
2021-06-15 00:49:18 -07:00
return true;
}
2022-02-28 13:29:21 +05:30
numberOfWaysToExpress();
2021-06-15 00:49:18 -07:00
```
# --solutions--
```js
// solution required
```