# Computing continued fraction

I want to build this infinite continued fraction

$$F_{n}(x)= \frac{1}{1-x\frac{(n+1)^2}{4(n+1)^2-1}F_{n+1}(x)}$$

which gives for $$n=0$$

$$F_{0}(x)=\dfrac{1}{1-\dfrac{(1/3)x}{1-\dfrac{(4/15)x}{1-\dfrac{(9/35)x}{1-\ddots}}}}$$ I took inspiration from this Post (@Michael E2), the problem is that when I transform it as a list representation

{b0,{a1, b1},{a2, b2},...}

Clear[F2,iF2];

iF2[0]=0;
iF2[1]={1,1};
iF2[2]={-x/3,1};
iF2[n_]:={-x(n+1)^2/(4(n+1)^2-1),1};
F2[n_]:=Table[iF2[k],{k,0,n}];


I can't find all the terms, so I find for 5 terms

Block[{n=5},F2[n]]
(*{0,{1,1},{-x/3,1},{-16x/63,1},{-25x/99,1},{-36x/143,1}}*)


it lacks after {$$-x/3,1$$} the terms {$$-4x/15,1$$} and {$$-9x/35,1$$}

What is wrong please?

• In your definition you should change + to -, that is iF2[n_]:={-x(n-1)^2/(4(n-1)^2-1),1}; – yarchik Jul 6 at 14:18

Nest [# /. F[n_] :> 1/(1 - x (n + 1)^2/(4 (n + 1)^2 - 1) F[n + 1]) &, F[0], 5]

• @Ulrich_Neumann, how to get the value for n=200000? – Gallagher Aug 31 at 18:55