18

How do I evaluate this function for given $s$?

$$\zeta(s) = \sum_{n=1}^\infty \frac1{n^s} = \frac{1}{1^s} + \frac{1}{2^s} + \frac{1}{3^s} + \cdots$$

3 Answers3

18

Assuming you're talking about numerical evaluation, along the critical strip $0<\Re s<1$ and "large" $\Im s$, (which is the region of interest for many) the Riemann-Siegel formula is standard; off the strip, what you can manage is a polyalgorithm.

For $\Re s\leq0$, one can use the reflection formula for $\zeta$,

$$\zeta(1-s)=\frac{2}{(2\pi)^s}\cos\left(\frac{s\pi}{2}\right)\Gamma(s)\zeta(s)$$

so we can consider evaluation for $\Re s>0$ in what follows.

Note that if $|s|$ is "large enough" (how large is "large" depends on the computing environment you're in), one can simply use the defining series $\zeta(s)=\sum\limits_{j=1}^\infty j^{-s}$, since its terms quickly diminish in magnitude. That leaves the problem of what to do for small to medium-sized $s$.

The key is to use the Dirichlet $\eta$ function:

$$\eta(s):=-\sum_{j=1}^\infty \frac{(-1)^j}{j^s}$$

which is related to $\zeta$ by the following identity:

$$\eta(s)=\left(1-2^{1-s}\right)\zeta(s)$$

The reason for our interest in $\eta$ is that although this sum is slowly convergent, it is an alternating series, and a number of algorithms exist for quickly finding the sum of an alternating series numerically.

One method is the Levin transformation; another one, which is one of the simplest methods for numerically summing alternating series (and my personal favorite) is the Cohen-Rodriguez Villegas-Zagier algorithm. The algorithm is a bit too long to describe here, so I will just have to point you to the original paper.

This is in fact identical to the approach taken by Borwein in this paper.

  • In Example 3 (p.6) of the Cohen, Rodriguez, Villegas and Zagier's paper the values $\zeta (1/2)$ and $\zeta (-1+i)$ of the Riemann zeta function are calculated. "The latter works even though the coefficients $a_{k}$ of our "alternating" series $\sum (-1)^{k}a_{k}$ are not alternating or even real and do not tend to zero."! – Américo Tavares Aug 25 '10 at 09:37
  • +1 for the Riemann-Siegel formula and Cohen-Rodriguez Villegas-Zagier algorithm. – Américo Tavares Aug 25 '10 at 10:57
  • Though CRVZ was used for evaluating $\zeta$ at $i-1$ in the paper, some numerical testing I did shows that the method can be unstable for some arguments with negative real part. This is why I recommended using the reflection formula instead for arguments in that region. – J. M. ain't a mathematician Aug 25 '10 at 16:31
  • On another note, Maple and Mathematica employ Euler-Maclaurin summation for computing $\zeta$; the problem with this of course is that there is the assumption that either you can easily generate or have a large enough cache of Bernoulli numbers (which is not a problem for Maple and Mathematica, but may be inconvenient in other environments). – J. M. ain't a mathematician Aug 25 '10 at 16:34
  • Yet another note: in fact, due to $\zeta$'s mirror symmetry ($\zeta(\bar{s})=\overline{\zeta(s)}$), one can actually restrict computations so that one is handling only arguments with real and imaginary part both positive. – J. M. ain't a mathematician Aug 27 '10 at 01:29
  • Don't you need to have the real part of s, not the modulus, be "large" to use the defining series? – castal Dec 03 '10 at 17:46
  • @castal: I did say "away from the critical strip". :) – J. M. ain't a mathematician Dec 03 '10 at 23:06
  • I've read Borwein's paper, but I've had trouble following it. I sent him an email a few years ago asking him about the following issues but got no response. First, on page 3, shouldn't the inequality right after "we observe that, by Algorithm 1" have a final integrand with $\left|\log x\right|^{\sigma-1}$ rather than $\left|\log x\right|^{s-1}$? Second, and more importantly, I don't see how he gets from the estimate "integral ≤ .68" to the following bound on $\left|\gamma_n(s)\right|$. – Joshua Green Dec 05 '14 at 02:55
4

You should look at the work of Wadim Zudilin. In particular you should look at "One of the numbers ζ(5), ζ(7), ζ(9), ζ(11) is irrational" (Turpion link, pdf 91k, gzip ps 80k) in Russian Math. Surveys 56:4 (2001), 774--776;

  • I add the work of Tanguy Rivoal on the same subject. For instance this http://arxiv.org/PS_cache/math/pdf/0104/0104221v2.pdf (in French). – Américo Tavares Aug 25 '10 at 21:19
  • There are of course special methods for evaluating $\zeta$ at even (using of course the relation with the Bernoulli numbers) and odd integers. Searching the literature should turn up the methods for $\zeta(2k+1)$. – J. M. ain't a mathematician Aug 25 '10 at 23:50
  • @J. Mangaldan Yes, of course. Euler was the first to give the formula for $\zeta(2)$ with several proofs, and as you say $\zeta(2n)$ can be expressed using the Bernoulli numbers $B_\nu$ (was that Euler too?). If someone could add a link it would be good. – AD - Stop Putin - Aug 26 '10 at 05:55
  • Indeed, it was Euler who computed values at even arguments from 2 to 26; and T.J. Stieltjes later extended these calculations by Euler. – J. M. ain't a mathematician Aug 27 '10 at 01:27
1

Early implementations are based on variations of the Riemann-Siegel formula. A key figure in the development of numerical algorithms was Andrew Odlyzko. He wrote two fundamental papers on calculating zeros on the critical line - Fast algorithms for multiple evaluations of the Riemann zeta function and Supercomputers and the Riemann zeta function. A bunch of other people (including Alan Turing) have contributed to the verification of the Riemann hypothesis. A good summary is included in the report by Xavier Gourdon.

More recently, practitioners have been working on improvements to the Odlyzko–Schönhage algorithm (also see here). Two key figures are Jonathan Bober and Ghaith Hiary. Hiary was a PhD student of Odlyzko who works on fast computations of Dirichlet functions (his thesis was on a variation of the Odlyzko–Schönhage algorithm). There is an implementation of the Odlyzko–Schönhage algorithm on Bober's webpage. However, this is fairly difficult to read.

A bunch of students have written there own implementations of the Riemann-Siegel formula. Perhaps the most well known is the C implementation written by Glen Pugh (this is sometimes incorrectly cited as his PhD thesis. Glen wrote a wonderful PhD thesis about Lanzcos Gamma Approximations). Another computer implementation in C++ was written by Ken Takusagawa.

I wrote my own Riemann-Siegel code in Julia. I summarized my findings in a report which was later expanded in a Beamer presentation.

If you are interested in writing your own implementation then I would suggest reading Riemann's Zeta Function by Harold M. Edwards. An English translation of Bernhard Riemann's eight-page paper entitled "On the Number of Primes Less Than a Given Magnitude" is included at the end of the book.

Axion004
  • 10,056