In how many ways can i obtain 4 using 0.125 and multiples? In how many ways can I obtain $4$ as a sum of : $0.125$, $0.25$, $0.5$, $1$, $2$, $4$ with repetitions of values?
The order of the sum is important, for example $(1, 1, 2)$ is different from $(1, 2, 1)$ and different from $(2, 1, 1)$,
 A: $4=32\times 0.125$, so write down
$$4 = \underbrace{0.125+\cdots +0.125}_{32 \text{ times}}.$$
Now it is just a matter of in how many appropriate ways you can group the $0.125$ summands to your actual summands. E.g. you can group it like that:
$$
4 = 
\underbrace{0.125+\cdots +0.125}_{4 \text{ times }\rightarrow\, 0.5}
+\underbrace{0.125+\cdots +0.125}_{4 \text{ times }\rightarrow\, 0.5}
+\underbrace{0.125+\cdots +0.125}_{8 \text{ times }\rightarrow\, 1}
+\underbrace{0.125+\cdots +0.125}_{16\text{ times }\rightarrow\, 2}
,
$$
which gives $4=0.5+0.5+1+2$. So the question is: in how many ways can you write the number $32$ as an ordered sum of powers of $2$. Lets investigate this recursively: The power $2^0=1$ can only be written in a single way, so define $s_0=1$. The power $2^n$ can be written as $2^n$ or decomposed in $2^{n-1}+2^{n-1}$ and the left and the right summand can both be independently decomposed in $s_{n-1}$ possible ways. So we have $s_n=1+s_{n-1}^2$. As $32=2^5$, you can check that this gives you $s_5=458330$ ways.
