How to expand a continued fraction generating function?

135 Views Asked by At

So given the sequence https://oeis.org/A227310 $a(n) = 1,1,0,0,1,0,0,1,0,1,1,0,2...$

with generationg function $\frac{1}{G(0)}$

with $G(k) = 1+ \frac{(-q)^{k+1}}{1-\frac{(-q)^{k+1}}{G(k+1)}}$

I am trying to expand this to get a better idea of how generating functions of this form work. When I try to expand this I don't get the sequence above as the coefficients of $q^n$

Below is my attempt,

This Expands into $G(0) = 1+\frac{-q^1}{1-\frac{-q^1}{1+\frac{q^2}{1-\frac{q^2}{...}}}}$

Then using the generalized continued fraction formula I get

$x_0 = \frac{A_0}{B_0}= \frac{1}{1}$

$x_1 = \frac{A_1}{B_1} = \frac{A_1}{b_1}= \frac{A_1}{1} = \frac{A_1}{1}$

$x_2 = \frac{A_2}{B_2} = \frac{A_2}{b_2b_1+a_2}=\frac{A_2}{(1)(1)+q^1}=\frac{A_2}{1+q^1}$

$x_3 = \frac{A_3}{B_3} = \frac{A_3}{b_3B_2+a_3B_1}= \frac{A_3}{(1)(1+q^1)+(q^2)(1)} = \frac{A_3}{1+q^1+q^2}$

$x_4 = \frac{A_4}{B_4} = \frac{A_4}{b_4B_3+a_4B_2}= \frac{A_4}{(1)(1+q^1+q^2)+(-q^2)(1+q^1)} =\frac{A_4}{1+q^1-q^3}$

$x_5 = \frac{A_5}{B_5} = \frac{A_5}{b_5B_4+a_5B_3}= \frac{A_5}{(1)(1+q^1-q^3)+(-q^3)(1+q^1+q^2)} =\frac{A_5}{1+q^1-2q^3-q^4-q^5}$

$x_6 = \frac{A_6}{B_6} = \frac{A_6}{b_6B_5+a_6B_4}= \frac{A_6}{(1)(1+q^1-2q^3-q^4-q^5)+(q^3)(1+q^1-q^3)} =\frac{A_6}{1+q^1-q^3+q^5-q^6}$

The sequence should be the coefficients of $q$ of $B_n$ right? I do not see how the $-q^3$ in $x_6$ will cancel and $a(3) = 0$. Where am I messing up?