I am working through Analysis of Algorithms by Sedgewick/Flajolet
On problem 3.44 I am given the recurrence, and I need to come up with a generating function. I have tried the various methods in the section (it isn't linear, I don't see how to do with a differential equation, nor does it appear to be a composition), but haven't had any success.
$f_{2n}=f_{2n-1}+f_n $ with $n>1$ and $f_0=0$
$f_{2n+1}=f_{2n}$ with $n>0$ and $f_1=1$
Thank you.
If $F_0(z)=\sum f_{2n}z^{2n}$ and $F_1(z)=\sum f_{2n+1}z^{2n+1}$ then I suppose it is easy to get from above equations to find $F_0$ and $F_1$. Then if $F(z)=\sum f_nz^n$ we have $F_0(z)=\frac{F(z)+F(-z)}{2}$, $F_1(z)=\frac{F_0(z)-F(-z)}{2}$, and $F(z)=F_0(z)+F_1(z)$.
We are going to take the equations, multiply by $z^{2n}$ and add for all $n$. We get form the first equation
$$F_0(z)=zF_1(z)+F(z^2)$$
From the second equation we get
$$F_1(z)=zF_0(z)$$
The equations might get altered by adding certain polynomials depending on the initial conditions and the domain of the recurrences.