## Ramanujan’s continued fraction for Catalan’s constant

Ramanujan was a goldmine when it came to continued fractions (and many others).  In this post, two families will be given: they involve pi and Catalan’s constant as special cases.  However, versions will be given that roughly double the rate of convergence.

Recall that Catalan’s constant C is given by,

$C = \sum_{n=0}^\infty \frac{(-1)^n}{(2n+1)^2} = 0.915965\dots$

Ramanujan gave the beautiful pair of continued fractions.  Let $|x| > 1$, then,

$f(x) = 2\sum_{n=0}^\infty \frac{(-1)^n}{(x+2n+1)^2} = \cfrac{1}{x^2-1 + \cfrac{2^2}{1 + \cfrac{2^2}{x^2-1 + \cfrac{4^2}{1 + \cfrac{4^2}{x^2-1 +\ddots}}}}}$

$g(x) \; = \;\frac{\Gamma^4 (\frac{x+1}{4})}{\Gamma^4 (\frac{x+3}{4})}\; =\; \cfrac{16}{x^2-1 + \cfrac{1^2}{1 + \cfrac{1^2}{x^2-1 + \cfrac{3^2}{1 + \cfrac{3^2}{x^2-1 +\ddots}}}}}$

One can just admire Ramanujan’s artistry — one continued fraction uses even numerators, the other, odd numerators.  For even x > 0, it is easily seen the first one involves Catalan’s constant.  For example,

$f(2) = 2(1-C)$

On the other hand, for odd x > 1, both involve pi,

$f(3) = \frac{1}{24}(12-\pi^2)$

$g(3) = \pi^2$

Notice though that numerators are repeated. Thanks to the insight of J.M. from a mathstackexchange post about Apery’s constant, we can speed up the rate of convergence of this particular form by getting rid of every other level and extracting even convergents.  After some slightly tedious algebraic manipulation, given,

$y = \cfrac{a_1}{b_1 + \cfrac{a_2}{1 + \cfrac{a_3}{b_2 + \cfrac{a_4}{1 +\ddots}}}}$

then,

$y_{even} = \cfrac{a_1}{b_1+a_2 - \cfrac{a_2\, a_3}{b_2+a_3+a_4 - \cfrac{a_4\, a_5}{b_3+a_5+a_6 - \cfrac{a_6\, a_7}{b_4+a_7+a_8 -\ddots}}}}$

So Ramanujan’s continued fractions are now the more compact,

$f(x) = 2\sum_{n=0}^\infty \frac{(-1)^n}{(x+2n+1)^2} = \cfrac{1}{u_1 - \cfrac{2^4}{u_2 - \cfrac{4^4}{u_3 - \cfrac{6^4}{u_4 -\ddots}}}}$

where, starting with n = 1,

$u_n = (2n-2)^2 + (2n)^2 + x^2-1$

and,

$g(x) \; = \; \frac{\Gamma^4 (\frac{x+1}{4})}{\Gamma^4(\frac{x+3}{4})}\; =\; \cfrac{16}{-1+v_1 - \cfrac{1^4}{v_2 - \cfrac{3^4}{v_3 - \cfrac{5^4}{v_4 -\ddots}}}}$

$v_n = (2n-3)^2 + (2n-1)^2 + x^2-1$

Thus, we have the slightly faster continued fraction for Catalan’s constant C,

$f(2) = 2(1-C) = \cfrac{1}{u_1 - \cfrac{2^4}{u_2 - \cfrac{4^4}{u_3 - \cfrac{6^4}{u_4 -\ddots}}}}$

where,

$u_n = 8n^2-8n+7$

(There is an even faster one by Zudilin given in An Apery-like difference equation for Catalan’s constant though he states this still does not prove C is irrational.)