Proceedings of Symposia in Applied Mathematics Volume 00, 0000

Ramanujan and Euler’s Constant

RICHARD P. BRENT

Abstract. We consider Ramanujan’s contribution to formulas for Euler’s constant γ. For example, in his second notebook Ramanujan states that (in modern notation)

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

as x → ∞. This is known to be correct for the case n = 1, but incorrect for n > 2. We consider the case n = 2. We also suggest a different, correct generalization of the case n = 1.

1. Introduction

Ramanujan gave many beautiful formulas for π and 1/π. Euler’s constant γ = −Γ′(1) = 0.57721566 …, which occurs in many well-known formulas involving the Gamma function, the Riemann zeta function, the divisor function d(n), etc. [15], seems to be more mysterious and more difficult to compute than π. For example, quadratically convergent iterations are known [6, 8, 21] for π, but none are known for γ. Also, π is transcendental, but it is not even known if γ is irrational [3]. If γ = p/q is rational, then q > 10^{15000}. This result follows from a computation [10] of the regular continued fraction expansion for γ.

There may be an analogy with ζ(3). Apéry [2, 17] 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

\begin{matrix}c \\ ◯ \end{matrix}1993 American Mathematical Society 0000-0000/00 $1.00 + $.25 per page

1991 Mathematics Subject Classification. Primary 01A60, 33C10, 41A60; Secondary 33-01, 33-03, 33E99, 40A25, 65D20.

To appear in Mathematics of Computation 1943–1993. rpb139 typeset using AMS-L^{A}TEX

involving ζ(3). Ramanujan [4, I, p. 252] rediscovered Euler’s formula

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

where H_{k} = ∑_{j=1}^{k} 1/j is a Harmonic number. Harmonic numbers also occur in formulas involving γ. For example, the well-known result

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

as n → ∞ is often used to give an alternative definition of γ.

2. Ramanujan’s Papers and Notebooks

Ramanujan published one paper [18] specifically on γ. In it he generalizes an interesting series of Glaisher:

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

Because the generalizations all involve the Riemann zeta function or related functions, 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 first printed in facsimile [20], and edited editions have since been published by Berndt [4]. Scanning the Notebooks, we find many occurrences of γ. Owing to space limitations, we concentrate on Chapter 4, Entry 9, Corollaries 1–2 [4, I, p. 98], because these are potentially useful for computing γ. Corollary 1 is (in modern notation)

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

as x → ∞. In fact, Euler showed the more precise result [4, II, p. 167],

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

and this has been used by Sweeney [22] and others [5, 9] to compute Euler’s constant (one has to be careful because of cancellation in the series). In Ch. 12, Entry 44(ii) [4, II, p. 168], Ramanujan correctly states that the error term O(e^{−x}/x) in (3) is between e^{−x}/(1 + x) and e^{−x}/x.

2.1. A Generalization. Ramanujan’s Corollary 2 [4, I, p. 98] is that

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

for n > 0. We assume that n is a fixed positive integer. Clearly (4) generalizes (2), which is just the case n = 1.

Berndt [4, I, p. 98], using a result of Olver [16, Ex. 8.4, p. 309], shows that (4) is false for n > 2, because the function defined by the left side of (4) changes sign infinitely often and grows exponentially large as x → ∞. Berndt leaves the case n = 2 open. In fact, (4) is true if n = 2. Theorem 1 below gives an exact expression for the error in (4) as an integral involving the Bessel function J_{0}(x), and Corollary 1 deduces an asymptotic expansion.

The exact expression for n = 2 is a special case of a formula given by Luke [13, p. 48] and [1, formula 11.1.20]. However, the connection with Ramanujan does not seem to have been noticed before.

2.2. Avoiding Cancellation. In Chapter 3, Entry 2, Corollary 2, Ramanujan states that the sum on the left side of (2) can be written as

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

This is easy to prove [4, I, pp. 46–47]. Thus, (2) gives

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

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

3. Ramanujan’s Corollary for n = 2

The following result [11] shows that (4) is valid for n = 2. Recall that J_{0}(x) 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.

We omit details of the proof of Theorem 1. However, the reader should be able to construct a proof by proceeding as in [4, I, p. 99], using the fact that

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

A slightly more general result than (6) is given in [12, equation 6.622.1] and is attributed to Nielsen [14]. An independent proof is given in [11].

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}} )).

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

4. A Different Generalization

Equation (4) may be obtained from (2) by replacing x^{k}/k! by (x^{k}/k!)^{n}/n. An analogous generalization of (5) is

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

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

It is easy to show that (7) is valid for all positive integer n. An essential difference between (4) and (7) is that there is a large amount of cancellation between terms of size Ω_{±}(e^{nx}x^{−(n+2)/2}) on the left side of (4), but there is no cancellation in the numerator and denominator on the left side of (7). The function (x^{k}/k!)^{n} acts as a smoothing kernel with a peak at k ≃ x − \frac{1}{2}. In view of (1), the result (7) is not surprising, but the speed of convergence may be surprising. Brent and McMillan [10] 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}) (8)

as x → ∞, where c_{n} = \begin{cases}1 & if n = 1, \\ 2n sin^{2}(π/n) & if n ≥ 2. \end{cases}

In the case n = 2, the formula (8) has error O(e^{−4x}). Brent and McMillan [10] 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 (4) 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 (4).

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

It would be interesting to consider the behaviour of the functions occurring in (4) and (8) for positive but non-integral values of n. Certainly (7) is valid for all positive n, but we do not know if (8) holds when n is positive but not an integer (assuming a suitable extension of the definition of c_{n}).

References

1. M. Abramowitz and I. A. Stegun (eds.), Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, National Bureau of Standards, Washington, 1964 (reprinted by Dover, 1965). (Chapter 11 was written by Y. L. Luke.)

2. R. Apéry, Irrationalité de ζ(2) et ζ(3), Journées arithmétiques Luminy, Astérisque 61 (1979), 11–13.

3. D. Bailey, Numerical results on the transcendence of constants involving π, e, and Euler’s constant, Math. Comp. 50 (1988), 275–281.

4. B. C. Berndt, Ramanujan’s Notebooks, Parts I–III, Springer-Verlag, New York, 1985–1991.

5. W. A. Beyer and M. S. Waterman, Error analysis of a computation of Euler’s constant, Math. Comp. 28 (1974), 599–604.

6. J. M. Borwein and P. B. Borwein, Pi and the AGM, John Wiley and Sons, New York, 1987.

7. J. M. Borwein, P. B. Borwein and D. H. Bailey, Ramanujan, modular equations, and approximations to pi or how to compute one billion digits of pi, Amer. Math. Monthly 96 (1989), 201–219.

8. R. P. Brent, Multiple-precision zero-finding methods and the complexity of elementary function evaluation, Analytic Computational Complexity (J. F. Traub, ed.), Academic Press, New York, 1975, 151–176.

9. R. P. Brent, Computation of the regular continued fraction for Euler’s constant, Math. Comp. 31 (1977), 771-777.

10. R. P. Brent and E. M. McMillan, Some new algorithms for high-precision computation of Euler’s constant, Math. Comp. 34 (1980), 305–312. (There is an error on page 310: in the definition of V_{p}(z), “z/k!” should be “z^{k}/k!”.)

11. R. P. Brent, An asymptotic expansion inspired by Ramanujan, Austral. Math. Soc. Gaz. (to appear). Also Report CMA-MR02-93, ANU, Feb. 1993 (available by ftp from

dcssoft.anu.edu.au in the directory pub/Brent).

12. I. S. Gradshteyn and I. M. Ryzhik, Tables of Integrals, Series, and Products, fourth edition (trans. Alan Jeffrey), Academic Press, New York, 1965.

13. Y. L. Luke, Integrals of Bessel Functions, McGraw-Hill, New York, 1962.

14. N. Nielsen, Theorie des Integrallogarithmus und verwandter Transzendenten, Teubner, Leipzig, 1906 (reprinted by Chelsea, New York, 1965).

15. J. Nunemacher, On computing Euler’s constant, Math. Mag. 65 (1992), 313–322.

16. F. W. J. Olver, Asymptotics and Special Functions, Academic Press, New York, 1974.

17. A. van der Poorten, A proof that Euler missed … Apéry’s proof of the irrationality of ζ(3), Math. Intelligencer 1 (1979), 195–203.

18. S. Ramanujan, A series for Euler’s constant γ, Messenger of Mathematics 46 (1917), 73–80 (reprinted in [19]).

19. S. Ramanujan, Collected Papers of Srinivasa Ramanujan (G. H. Hardy, P. V. Seshu Aiyar and B. M. Wilson, eds.), Cambridge University Press, Cambridge, 1927. Reprinted by Chelsea, New York, 1962.

20. S. Ramanujan, Notebooks, two volumes, Tata Institute of Fundamental Research, Bombay, 1957.

21. E. Salamin, Computation of π using arithmetic-geometric mean, Math. Comp. 30, 1976, 565–570.

22. D. Sweeney, On the computation of Euler’s constant, Math. Comp. 17 (1963), 170–178.

Computer Sciences Lab., Australian National University, Canberra, ACT 0200, Australia

E-mail address: rpb@cslab.anu.edu.au