WOLFRAM|DEMONSTRATIONS PROJECT

A Remarkable Formula Of Ramanujan

​
interval
small
big
continued fraction terms
series terms
Srinivasa Ramanujan (1887-1920)
​
x

π
2x
=
1
x+
1
1+
2
x+
3
1+
4
x+⋯
+ 1 +
x
13
+
2
x
35
+
3
x
357
+
4
x
3579
+ ⋯
The function
f(x)=
x

π
2x
(for
x>0
​
) can be decomposed into a sum of a continued fraction and a series. The best-known case of this formula corresponds to
x=1
. It is surprising that, separately, neither the continued fraction nor the series can be expressed in terms of
π
or
e
. When
x
is not too big, both the continued fraction and the series significantly contribute to the approximation
f
a
(x)
(in green) of
f(x)
(in magenta); for large values of
x
, the contribution comes nearly exclusively from the series. This can be seen in the first graph, using the "small" or the "big" interval. In the second graph, the base 10 logarithm of the relative error
|1-f(x)/
f
a
(x)|
is shown, which corresponds to the digit in which the error appears (higher negative means more precision).