## Some of Ramanujan’s continued fractions for pi

The digits of pi go on forever apparently with no discernible pattern. However, there are beautifully simple patterns in its (ironically) non-simple continued fraction expansions. Examples are,

$\pi = \cfrac{4}{1 + \cfrac{1^2}{2 + \cfrac{3^2}{2 + \cfrac{5^2}{2 + \ddots} }}}$

known by Lord Brouncker (1620-1684), and,

$\pi = 3 + \cfrac{1^2}{6 + \cfrac{3^2}{6 + \cfrac{5^2}{6 + \ddots} }}$

One can see the affinity between the two.  They in fact belong to the same family.  Given complex numbers {n, x} with $Re[x] > 0$, then,

$F(n,x) = \Large{\frac{\Gamma\left(\frac{x+n+1}{4} \right)\Gamma\left(\frac{x-n+1}{4} \right) }{\Gamma\left(\frac{x+n+3}{4} \right)\Gamma\left(\frac{x-n+3}{4} \right)}} = \cfrac{4}{x + \cfrac{1^2-n^2}{2x + \cfrac{3^2-n^2}{2x + \cfrac{5^2-n^2}{2x + \ddots} }}}$

where $\Gamma(\tau)$ is the gamma function.  This is Entry 25 in Ramanujan’s Second Notebook (Chapter 12) though this result was also known by Euler. For the case = 0, the continued fraction assumes the form of the examples and the function simplifies as,

$F(0,x) = \frac{\Gamma^2\left(\frac{x+1}{4}\right)}{\Gamma^2\left(\frac{x+3}{4}\right)}$

For x an odd integer, then (0, x) is a rational multiple of $\pi$ or $1/\pi$.  Specifically, for x = {1, 3, 5, 7, 9}, we have,

$F(0,x) = \pi,\; \frac{4}{\pi}, \frac{\pi}{4}, \frac{16}{9\pi}, \frac{9\pi}{64}$

More generally,

$F(0,4m+1) = \big(\frac{(2m)!}{m!^2}\big)^2\, \frac{\pi}{2^{4m}}$

$F(0,4m+3) = \big(\frac{m!^2}{(2m+1)!}\big)^2\, \frac{2^{4m+2}}{\pi}$

See p. 178 of Annie Cuyt’s HandBook of Continued Fractions for Special Functions.  For more examples, see also this article Ramanujan’s Continued Fractions, Apery’s Constant, and more.