At first, we define f(0)=1 and f(n) to be the numbers of ways n can be represented as a sum of powers of 2. But the restriction is that no power can be repeated more than 2 twice.
For example, f(10)=5 since, 10=8+2, 10=8+1+1, 10=4+4+2, 10=4+4+1+1, 10=4+2+2+1+1.
I am looking for an algorithm which can calculate this function f. I suspect, it has something to do with recurrence.
In Mathematica: