Closed form of $a_{n+2}=a_{n+1}a_n+1$

87 Views Asked by At

I was given this sequence and I need to find a closed form. $$a_0=1,a_1=2$$ $$\text{and } \forall n \geq0\text{ } a_{n+2}=a_{n+1}a_n+1$$ I tried defining the following generating function: $$A(q)=\sum_{n=0}^\infty a_nq^n$$ Then I managed to find that $$A(q)=\frac{1}{1-q}+\frac{q}{1-q}-\frac{2q^2}{1-q}+\frac{q^2}{(1-q)^2}$$ But I don't know how to take it from here. I'm assuming we need to do some partial fraction decomposition in a certain way but I can't seem to figure out how.