Finding the coefficient of a generating function $f$

110 Views Asked by At

Finding the coefficient of a generating function $$f(x)=\dfrac{(1+x^4)(1+x^{4^2}) \cdots (1+x^{4^n})\cdots}{1-x}$$ I once searched for the problem when replacing the number $4$ with the number $2$. At that point, it is possible to simplify $f$. The above issue is not straightforward for me.

1

There are 1 best solutions below

6
On

If we expand $\prod\limits_{k=1}^\infty (1+x^{4^k})$, we get the sum of $x^n$ over all $n$ that only have even positive powers of $2$ in binary.

Dividing this by $1-x$ is equivalent to multiplying it by $1+x+x^2+\dots$, thus $[x^n] f(x)$ is the number of integers from $0$ to $n$ that only have even powers of $2$ in their binary representation.

While exact number can also be derived from the binary representation of $n$, it isn't very pretty.