L-functions

Zeta and L values

ζ(2)=π2/6\zeta(2) = \pi^2/6, ζ(−1)=−1/12\zeta(-1) = -1/12, 1−13+15−⋯=π/41 - \tfrac13 + \tfrac15 - \cdots = \pi/4: special values of zeta and L functions carry arithmetic. Some are exact, and those are returned exactly. Everywhere else the value comes as an interval with rational endpoints that provably contains it.

The functions

For a Dirichlet character χ\chi,

L(s,χ)=∑n≥1χ(n)ns=∏p(1−χ(p)ps)−1(Re⁡s>1), L(s, \chi) = \sum_{n \ge 1} \frac{\chi(n)}{n^s} = \prod_p \left(1 - \frac{\chi(p)}{p^s}\right)^{-1} \qquad (\operatorname{Re} s > 1),

and the Riemann zeta function is the case of the trivial character. Each extends to the whole complex plane, with a single pole at s=1s = 1 when χ\chi is principal and none otherwise.

Exact values

At the non-positive integers the values are rational numbers given by Bernoulli numbers, ζ(−n)=−Bn+1/(n+1)\zeta(-n) = -B_{n+1}/(n+1), and at the positive even integers Euler's formula gives a rational multiple of a power of π\pi.

import { bernoulli, zetaExact, lValueExact, kroneckerCharacter, dirichletCharacter } from "@ratmath/numtheory";

[0, 1, 2, 4, 6, 12].map(bernoulli);    // 1, -1/2, 1/6, -1/30, 1/42, -691/2730
zetaExact(-1);                 // -1/12
zetaExact(-3);                 // 1/120
zetaExact(-2);                 // 0: a trivial zero
String(zetaExact(2));          // "π^2/6"
String(zetaExact(12));         // "691π^12/638512875"
zetaExact(12).coefficient;     // 691/638512875

For a character the same holds with generalised Bernoulli numbers: L(1−k,χ)=−Bk,χ/kL(1 - k, \chi) = -B_{k,\chi}/k, where Bk,χ=qk−1∑a=1qχ(a)Bk(a/q)B_{k,\chi} = q^{k-1}\sum_{a=1}^{q} \chi(a) B_k(a/q). For a real character the value is a Rational; for a complex one it lies in the cyclotomic field of the character's order.

lValueExact(kroneckerCharacter(-23), 0);     // 3
lValueExact(kroneckerCharacter(-163), 0);    // 1
lValueExact(kroneckerCharacter(-4), 0);      // 1/2
lValueExact(kroneckerCharacter(5), -1);      // -2/5
String(lValueExact(dirichletCharacter(5, 2), 0));   // "3/5 + (1/5)ζ4": (3 + i)/5

The first lines are the class number formula. For a negative fundamental discriminant DD, with ww roots of unity in Q(D)\mathbb{Q}(\sqrt D),

h(D)=w2 L(0,χD)=w∣D∣2π L(1,χD). h(D) = \frac{w}{2}\, L(0, \chi_D) = \frac{w\sqrt{|D|}}{2\pi}\, L(1, \chi_D).

So L(0,χ−23)=3L(0, \chi_{-23}) = 3 is the class number of Q(−23)\mathbb{Q}(\sqrt{-23}), found on the Class groups page by entirely different means, and L(0,χ−163)=1L(0, \chi_{-163}) = 1 is the reason eπ163e^{\pi\sqrt{163}} is so nearly a whole number.

Enclosures

At other points there is no closed form. zetaValue and lValue return a RationalInterval narrower than 2−bits2^{-\text{bits}} (64 by default) that contains the true value. The argument is given exactly: a whole number, a fraction as text, or [σ, t] for the point σ+it\sigma + it of the plane, in which case the result is { re, im }.

import { zetaValue, lValue, hurwitzZeta } from "@ratmath/numtheory";

const z = zetaValue(3);                 // Apéry's constant
z.compactedDecimalInterval();           // "1.202056903159594285[38:41]"
zetaValue(3, { bits: 200 });            // sixty digits

zetaValue("1/2").low.toNumber();        // -1.4603545088095868

const w = zetaValue(["1/2", 14]);       // near the first zero, 1/2 + 14.1347…i
[w.re.low.toNumber(), w.im.low.toNumber()];     // [0.02224114…, -0.10325812…]

lValue(kroneckerCharacter(-4), 1).compactedDecimalInterval();    // "0.7853981633974483096[1:3]" = π/4
lValue(kroneckerCharacter(8), 1).low.toNumber();                 // 0.6232252401402305 = ln(1 + √2)/√2
lValue(dirichletCharacter(7, 3), [2, 5]);                        // { re, im }: a complex character, off the real line

The last real example is the class number formula for a real quadratic field: hln⁡ε=D2L(1,χD)h \ln \varepsilon = \tfrac{\sqrt D}{2} L(1, \chi_D), here with h=1h = 1 and the unit ε=1+2\varepsilon = 1 + \sqrt 2 from the Units page.

How the enclosures are proved

Every L-function is a combination of Hurwitz zeta functions ζ(s,a)=∑n≥0(n+a)−s\zeta(s, a) = \sum_{n \ge 0} (n + a)^{-s}:

L(s,χ)=q−s∑a=1qχ(a) ζ ⁣(s,aq). L(s, \chi) = q^{-s} \sum_{a=1}^{q} \chi(a)\, \zeta\!\left(s, \tfrac{a}{q}\right).

And ζ(s,a)\zeta(s, a) is computed by the Euler–Maclaurin formula: sum the first NN terms directly, replace the rest by an integral, and correct with Bernoulli numbers,

ζ(s,a)=∑n=0N−11(n+a)s+(N+a)1−ss−1+12(N+a)s+∑j=1MB2j(2j)! s(s+1)⋯(s+2j−2)(N+a)s+2j−1+R, \zeta(s, a) = \sum_{n=0}^{N-1} \frac{1}{(n+a)^s} + \frac{(N+a)^{1-s}}{s-1} + \frac{1}{2(N+a)^s} + \sum_{j=1}^{M} \frac{B_{2j}}{(2j)!}\, \frac{s(s+1)\cdots(s+2j-2)}{(N+a)^{s+2j-1}} + R,

with the remainder bounded explicitly:

∣R∣≤4 ∣s(s+1)⋯(s+2M−1)∣(2π)2M⋅(N+a)−(σ+2M−1)σ+2M−1,σ=Re⁡s>1−2M. |R| \le \frac{4\,|s(s+1)\cdots(s+2M-1)|}{(2\pi)^{2M}} \cdot \frac{(N+a)^{-(\sigma+2M-1)}}{\sigma+2M-1}, \qquad \sigma = \operatorname{Re} s > 1 - 2M.

The formula holds wherever the bound makes sense, which is how it reaches the left half plane and the critical strip. Every operation is done in ball arithmetic: a midpoint and a radius, with each rounding added to the radius, and exponentials, logarithms, sines and cosines carrying their own error bounds. The remainder bound is added at the end. At s=1s = 1 the poles of the individual ζ(s,a/q)\zeta(s, a/q) cancel because ∑χ(a)=0\sum \chi(a) = 0, and the limit is taken exactly.

hurwitzZeta(2, "1/4").low.toNumber();   // 17.197329154507… = π² + 8G, with G Catalan's constant

// an enclosure contains the exact value where there is one
const e = zetaValue(-5, { bits: 100 });
const x = zetaExact(-5);                // -1/252
e.low.lessThanOrEqual(x) && x.lessThanOrEqual(e.high);    // true

Limits: the modulus of the character is at most 5000 for enclosures, and the cost grows with the modulus and with the height ∣t∣|t|. For the zeros of ζ\zeta, with proof that they lie on the critical line, see the gamma and zeta page of @ratmath/complex.

Try itEdit the code and run it with @ratmath/numtheory and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.
Ctrl/⌘ + Enter runs