Binary partition function
Hello, I am trying to figure out how to return the number of partitions of n as powers of 2 (sometimes called the binary partition function b(n)). For example, 4=22=21+20+20=20+20+20+20, then b(4)=3.
I just can't get anything to work. I would really appreciate some help. Thank you so much! This community is always so helpful!
If the code can be written so that it gives the number of partitions of n as powers of k that would be unbelievably helpful.