I was looking into this continued fraction:
$$e = 3 - \frac{1}{4 - \frac{2}{5 - \frac{3}{6 -...}}}$$
I was able to duplicate the approximations of the continued fraction with this recursive formula:
$$f(n+1) = \frac{f(n)*(n+1)*(n+2)^2*(n+1)!-1}{(n+1)*(n+2)*(n+2)!}\tag{1}$$
Where $f(0)=3$
The first few terms are:
$f(1)=11/4=2.75$
$f(2)=49/18=2.72222$
$f(3)=261/96=2.71875$
$f(4)=1631/600=2.71833$
...
Is there a general way to convert continued fractions into recursive formulas?
Or do these need to be dealt with on a case by case basis?
This is a reply to a comment by WA Don
Thank you for your thoughtful reply.
Which of my terms is off?
In the meantime, I'll provide a more detailed derivation.
The denominator, as a function of n, can be represented as: $$g(n)=(n+1)*(n+1)!$$ The numerator, as a recursive function of n, can be represented as: $$h(n)=(h(n-1)*(n+1)^2-1)/n$$ So we now can write the recursive approximation of e as: $$f(n)=h(n)/g(n)$$ $$=\frac{(h(n-1)*(n+1)^2-1)/n}{(n+1)*(n+1)!}$$ $$=\frac{h(n-1)*(n+1)^2-1}{n*(n+1)*(n+1)!}\tag{2}$$ Now substituting $h(n-1)=f(n-1)*g(n-1)$ into (2), we get $$f(n)=\frac{f(n-1)*g(n-1)*(n+1)^2-1}{n*(n+1)*(n+1)!}$$ $$=\frac{f(n-1)*n*n!*(n+1)^2-1}{n*(n+1)*(n+1)!}\tag{3}$$ Substituting n+1 for n in (3), we get
$$f(n+1)=\frac{f(n)*(n+1)*(n+1)!*(n+2)^2-1}{(n+1)*(n+2)*(n+2)!}\tag{4}$$
Which is just the original formula (1)
I'm still seeing an exact match between the continued fraction approximation and the recursive function in (1) or (4).
So, if there is an error in the forgoing, I'd be grateful to have it pointed out. And the specific term that deviates from the continued fraction approximation.
The first few terms without removing common factors are:
$f(1)=11/4$
$f(2)=98/36$
$f(3)=783/288$
$f(4)=6524/2400$
$f(5)=58715/21600$
$f(6)=575406/211680$
...