Special functions
Riemann zeta function
special.riemann-zetaAlso called zeta, riemann zeta, zeta function, dirichlet series
The Dirichlet series of the Riemann zeta function, convergent for s > 1. At even whole s it is a rational multiple of a power of π: ζ(2) = π2/6, ζ(4) = π4/90.
Notation
the exponent
s > 1
Result: the zeta function
scalar
Worked examples
Each result is solved exactly and confirmed by two independent computations.
Given
Result
≈ 1.64493406685
Given
Result
≈ 1.08232323371
Given
Result
≈ 1.01734306198
Common mistakes
Stops the series after a fixed number of terms
The tail beyond N terms is about N1−s/(s − 1); with N = 1000 and s = 1.1 that is 5, larger than the partial sum's error budget by many orders of magnitude.
Fix: Sum a few terms and add the Euler–Maclaurin tail, or call a library zeta.
Alternates the signs of the terms
Σ (−1)k−1/ks is the Dirichlet eta function, η(s) = (1 − 21−s) ζ(s).
Fix: Keep every term positive, or divide η(s) by 1 − 21−s.
Source
DLMF, eq. 25.2.1
NIST Digital Library of Mathematical Functions. https://dlmf.nist.gov/ Release 1.2.8 of 2026-09-15. F. W. J. Olver, A. B. Olde Daalhuis, D. W. Lozier, B. I. Schneider, R. F. Boisvert, C. W. Clark, B. R. Miller, B. V. Saunders, H. S. Cohl, and M. A. McClain, eds.