Ramanujan and Euler’s Constant^{∗}

Richard P. Brent Computer Sciences Laboratory Australian National University

         rpb@cslab.anu.edu.au

August 1993

∗Presented at Mathematics of Computation 1943– 1993, Vancouver, August 1993. Copyright \begin{matrix}c \\ ◯ \end{matrix}1993, R. P. Brent. rpb139t typeset using LaTEX

Motivation

Ramanujan gave many beautiful formulas for π and 1/π. See, for example, J. M. Borwein and P. B. Borwein, Pi and the AGM, John Wiley and Sons, New York, 1987; also (same authors) “Ramanujan and Pi”, Scientific American, February 1988, 66–73.

Euler’s constant

γ = −Γ′(1) ≃ 0.577

is more mysterious than π. For example, unlike π, we do not know any quadratically convergent iteration for γ. We do not know if γ is transcendental. We do not even know if γ is irrational, though this seems likely. All we know is that if γ = p/q is rational, then q > 10^{15000}. This follows from a computation of the regular continued fraction expansion for γ.

Analogy with ζ(3)

Apéry proved ζ(3) irrational using the series

ζ(3) = \frac{5}{2} ∑_{k=1}^{∞} \frac{(−1)^{k−1}k!k!}{(2k)!k^{3}}

and, in Chapter 9 of his Notebooks, Ramanujan gives several similar series, some involving ζ(3).

Ramanujan rediscovered Euler’s formula

ζ(3) = ∑_{k=1}^{∞} \frac{H_{k}}{(k + 1)^{2}} ,

where

H_{k} = ∑_{j=1}^{k} \frac{1}{j}

is a Harmonic number. Harmonic numbers also occur in formulas involving γ (examples later).

Thus, it is natural to look in the work of Ramanujan for formulas involving γ, in the hope that some of these might be useful for computing accurate approximations to γ, or even for proving that γ is irrational.

Ramanujan’s Papers and Notebooks

Ramanujan published one paper specifically on γ: “A series for Euler’s constant γ”, Messenger of Mathematics 46 (1917), 73–80 (reprinted in Collected Papers of Srinivasa Ramanujan). In the paper he generalizes an interesting series which was first discovered by Glaisher:

γ = 1 − ∑_{k=1}^{∞} \frac{ζ(2k + 1)}{(k + 1)(2k + 1)}.

This family of series all involve the Riemann zeta function or related functions, so they are not convenient for computational purposes.

Much of Ramanujan’s work was not published during his lifetime, but was summarized in his Notebooks. These were printed in facsimile in 1957, and edited editions have been published by Berndt. In the following, page numbers refer to Berndt’s edition (Part I for Chapters 1–9, Part II for Chapters 10–15).

Note that what Ramanujan calls a “Corollary” may in fact be an independent result.

γ in Ramanujan’s Notebooks

Scanning Berndt, we find many occurrences of γ. Some involve the logarithmic derivative ψ(x) of the gamma function, or the sum

H_{x} = ∑_{k=1}^{x} 1/k,

which we can interpret as ψ(x + 1) + γ if x is not necessarily a positive integer (Ch. 8, pg. 181). There are also applications of the result

H_{n} = ln n + γ + O(1/n)

as n → ∞. See, for example, Berndt’s proof of Ch. 14, Entry 22(iii), pg. 280: a complicated formula involving

∑_{n=1}^{∞} \frac{cos \sqrt{αn}}{n(cosh \sqrt{αn} − cos \sqrt{αn})},

where α > 0.

Other interesting formulas involving γ occur in Chapters 14–15, e.g. Ch. 15, Entry 1, examples (i–ii), pp. 303–304.

Chapter 4, Entry 9

Due to limitations of time, we shall concentrate on Chapter 4, Entry 9, Corollaries 1–2 (pg. 98), because these are potentially useful for computing γ. Corollary 1 is

∑_{k=1}^{∞} \frac{(−1)^{k−1}x^{k}}{k!k} ∼ ln x + γ  (1)

as x → ∞. In fact, Euler showed that

∑_{k=1}^{∞} \frac{(−1)^{k−1}x^{k}}{k!k} −ln x−γ = ∫_{x}^{∞} \frac{e^{−t}}{t} dt = O (\frac{e^{−x}}{x} )

and this has been used by Sweeney and others to compute Euler’s constant (one has to be careful because of cancellation in the series). In Ch. 12, Entry 44(ii), Ramanujan states Euler’s result that the error is between e^{−x}/(1 + x) and e^{−x}/x.

A Generalization

Ramanujan’s Corollary 2, Entry 9, Chapter 4 (page 98) is that, for positive integer n,

∑_{k=1}^{∞} \frac{(−1)^{k−1}}{nk} (\frac{x^{k}}{k!} )^{n} ∼ ln x + γ  (2)

so (1) is just the case n = 1.

Berndt (using a result from Olver’s book) shows that (2) is false for n ≥ 3. In fact, the function defined by the left side of (2) changes sign infinitely often, and grows exponentially large as x → ∞. However, Berndt leaves the case n = 2 open.

We shall sketch a proof that (2) is true in the case n = 2. In fact, we shall obtain an exact expression for the error in (2) as an integral involving the Bessel function J_{0}(x), and deduce an asymptotic expansion.

The exact expression for n = 2 is a special case of a formula given on page 48 of Y. L. Luke, Integrals of Bessel Functions, 1962. However, the connection with Ramanujan does not seem to have been noticed before.

Avoiding Cancellation

In Chapter 3, Entry 2, Cor. 2, page 46, Ramanujan states that the sum

∑_{k=1}^{∞} \frac{(−1)^{k−1}x^{k}}{k!k}

occurring in (1) can be written as

e^{−x} ∑_{k=0}^{∞} H_{k} \frac{x^{k}}{k!} .

This is easy to prove (Berndt, page 47). Thus (1) gives

∑_{k=0}^{∞} H_{k} \frac{x^{k}}{k!} /∑_{k=0}^{∞} \frac{x^{k}}{k!} ∼ ln x + γ.  (3)

This is more convenient than (1) for computation, because there is no cancellation in the series when x > 0. Later we indicate how Ramanujan might have generalized (3) in much the same way that he attempted to generalize (1).

Ramanujan’s Corollary for n = 2

The following result^{1} shows that (2) is valid for n = 2. Recall that

J_{0}(x) = ∑_{k=0}^{∞} \frac{(−1)^{k}(x/2)^{2k}}{k!k!}

is a Bessel function of the first kind and order zero.

Theorem 1 Let

e(x) = ∑_{k=1}^{∞} \frac{(−1)^{k−1}}{2k} (\frac{x^{k}}{k!} )^{2} − ln x − γ.

Then, for real positive x,

e(x) = ∫_{2x}^{∞} \frac{J_{0}(t)}{t}dt.

1R. P. Brent, Austral. Math. Soc. Gazette, to appear.

Also Report CMA-MR02-93, ANU, Feb. 1993. Available by ftp from dcssoft.anu.edu.au in the directory pub/Brent.

Sketch of Proof. Proceed as on pg. 99 of Berndt, and use the fact that

∫_{0}^{∞} (\frac{e^{−t} − J_{0}(2t)}{t}) dt = 0.  (4)

A slightly more general result than (4) is given in equation 6.622.1 of Gradshteyn and Ryzhik, and is attributed to Nielsen. An independent proof is given in the Report mentioned above.

Corollary 1 Let e(x) be as in Theorem 1. Then, for large positive x, e(x) has an asymptotic expansion

e(x) = \frac{1}{2π^{1/2}x^{3/2}} (cos (2x + \frac{π}{4} ) +

\frac{13 sin (2x + \frac{π}{4} )}{16x} + O (\frac{1}{x^{2}} )).

We see that, for computational purposes, it is much better to take n = 1 than n = 2 in (2), because the error for n = 1 is O(e^{−x}/x).

A Different Generalization

We obtained (2) from (1) by replacing x^{k}/k! by (x^{k}/k!)^{n}/n. A similar generalization of (3) is

∑_{k=0}^{∞} H_{k} (\frac{x^{k}}{k!} )^{n} /∑_{k=0}^{∞} (\frac{x^{k}}{k!} )^{n} ∼ ln x + γ (5)

as x → ∞. (3) is just the case n = 1.

It is easy to show that (5) is valid for all positive integer n. An essential difference between (2) and (5) is that there is a large amount of cancellation between terms on the left side of (2), but there is no cancellation in the numerator and denominator on the left side of (5). The function (x^{k}/k!)^{n} acts as a smoothing kernel with a peak at k ≃ x − \frac{1}{2}. Since

H_{k} = ln k + γ + O(1/k),

the result (5) is not surprising. What may be surprising is the speed of convergence.

Speed of Convergence

Brent and McMillan (Math. Comp. 34 (1980), 305–312) show that

∑_{k=0}^{∞} H_{k} (\frac{x^{k}}{k!} )^{n} /∑_{k=0}^{∞} (\frac{x^{k}}{k!} )^{n} = ln x+γ+O(e^{−c_{n}x})

(6)

as x → ∞, where

c_{n} = \{ \begin{matrix}1, & if n = 1; \\ 2n sin^{2}(π/n), & if n ≥ 2. \end{matrix}

In the case n = 2, (6) has error O(e^{−4x}). Brent and McMillan used this case with x ≃ 17,400 to compute γ to more than 30,000 decimal places. From Corollary 1, the same value of x in (2) would give less than 8-decimal place accuracy. Also, more than 15,000 decimal places would have to be used in the computation to compensate for cancellation of terms Ω_{±}(e^{2x}/x^{2}) in (2) !

The case n = 3 of (6) is interesting because max c_{n} = c_{3} = 4.5. However, no one seems to have used n > 2 in a serious computation of γ.

Suggestion for Further Work

Our analysis has assumed that n in (2) and (6) is a positive integer. It would be interesting to consider the behaviour of the functions occurring in these equations for positive but non-integral values of n, especially in the range 1 < n < 2.

Conclusion

We did not succeed in proving that γ is irrational, or in finding better algorithms for computing γ, but the quest was worthwhile because it provided an excellent motivation to read Ramanujan’s papers and Notebooks.