Skip to content

HurwitzZeta ​

The Hurwitz zeta function ζ(s,a)=∑n=0∞(n+a)−s\zeta(s, a) = \sum_{n=0}^{\infty} (n+a)^{-s} for Re⁡(s)>1\operatorname{Re}(s) > 1, continued analytically elsewhere. Provided by @enumeratio/analytic.

✓ checked against that system · ! checked, with disagreements (hover a chip)WikipediaHurwitz zeta functionMathWorldHurwitzZetaFunctionWikidataQ1638777DLMF25.11.E1FungrimHurwitzZeta✓Fungrim entryWolfram LanguageHurwitzZeta!
HurwitzZeta(s, a)the Hurwitz zeta function ζ(s,a)\zeta(s, a).
Typed signatures
TypePackageApplies
(complex | infinity, complex | infinity, integer?) -> numberanalyticreplaces compute-enginealways
(complex | infinity, complex | infinity, integer?) -> numbercompute-enginealways

Domain: Special functions

Details

The Hurwitz zeta function ζ(s,a)=∑n=0∞(n+a)−s\zeta(s, a) = \sum_{n=0}^{\infty} (n+a)^{-s} (DLMF 25.11.1) generalizes Zeta by shifting the summation index by a parameter aa; the series converges for Re⁡(s)>1\operatorname{Re}(s) > 1 and aa off the nonpositive reals, and continues analytically elsewhere to a function meromorphic in ss with a single simple pole at s=1s = 1.

  • Generalizes the Riemann zeta: ζ(s,1)=ζ(s)\zeta(s, 1) = \zeta(s), and ζ(s,m)=ζ(s)−∑k=1m−1k−s\zeta(s, m) = \zeta(s) - \sum_{k=1}^{m-1} k^{-s} for a positive integer mm (so ζ(2,2)=π2/6−1\zeta(2, 2) = \pi^2/6 - 1).
  • Nonpositive integer ss: ζ(−n,a)=−Bn+1(a)/(n+1)\zeta(-n, a) = -B_{n+1}(a)/(n+1), a Bernoulli polynomial in aa -- so ζ(0,a)=12−a\zeta(0, a) = \tfrac12 - a and ζ(−1,a)=−112(6a2−6a+1)\zeta(-1, a) = -\tfrac{1}{12}(6a^2 - 6a + 1). See BernoulliB.
  • Pole at s=1s = 1: ζ(1,a)=ComplexInfinity\zeta(1, a) = \text{ComplexInfinity} for every aa.
  • Poles at a=0,−1,−2,…a = 0, -1, -2, \dots: the (n+a)=0(n+a)=0 term is singular. (The two-argument Zeta drops that term instead, staying finite there.)
  • Numeric evaluation (under N()) is Euler–Maclaurin summation and supports complex ss and aa; it is aligned with Wolfram's HurwitzZeta[s,a]\mathrm{HurwitzZeta}[s, a]. Left of Re⁡(s)=0\operatorname{Re}(s) = 0, where those direct terms cancel, aa near the real axis goes through ζ(s,1+h)=∑k(−sk)hkζ(s+k)\zeta(s, 1+h) = \sum_k \binom{-s}{k} h^k \zeta(s+k) instead, each ζ(s+k)\zeta(s+k) from the functional equation.
  • That Euler–Maclaurin sum runs in arbitrary precision (as many digits as ce.precision asks for, checked against mpmath at 30 and 50 digits) whenever ss and aa are both real; a genuinely complex ss or aa is correct to the same number of digits internally, but the returned value is still one of compute-engine's own complex numbers, which is a pair of doubles -- so asking N() for 30 or 50 digits of a complex result gives back the same ~15-17 correct digits either way, a ceiling of compute-engine's complex-number representation rather than of this computation.
  • Certified digits: for exact real s≠1s \ne 1 and a>0a > 0 (integers, rationals or decimals), N(ζ(s,a),d)\mathrm{N}(\zeta(s, a), d) is proven. The Euler–Maclaurin sum runs in ball arithmetic, and its remainder after MM Bernoulli pairs is bounded by 4∣(s)2M∣ z1−s−2M/((2π)2M(s+2M−1))4|(s)_{2M}|\,z^{1-s-2M} / ((2\pi)^{2M}(s + 2M - 1)), z=N+az = N + a (Johansson 2015); the d digits are those both ends of the enclosure round to. See N.

Examples

177 more kept as data, checked against the oracles
Basic #

ζ(2,1)=ζ(2)=π2/6\zeta(2, 1) = \zeta(2) = \pi^2/6 -- reduces to the ordinary zeta

live ↗
InHurwitzZeta(2,1)\mathrm{HurwitzZeta}(2, 1)Outπ26\frac{π^2}{6}

ζ(2,2)=π2/6−1\zeta(2, 2) = \pi^2/6 - 1

live ↗
InHurwitzZeta(2,2)\mathrm{HurwitzZeta}(2, 2)Outπ26−1\frac{π^2}{6}-1

An inexact aa evaluates numerically without N(): ζ(3,0.2)=125.739…\zeta(3, 0.2) = 125.739\ldots

live ↗
InHurwitzZeta(3,0.2)\mathrm{HurwitzZeta}(3, 0.2)Out125.739 018 057 217 95125.739\,018\,057\,217\,95

Inside the critical strip, under N()

live ↗
InN(HurwitzZeta(0.51,0.87))N(\mathrm{HurwitzZeta}(0.51, 0.87))Out−1.320 155 023 694 958 375 51-1.320\,155\,023\,694\,958\,375\,51
live ↗
InNormal⁡(Series⁡(HurwitzZeta(2,x),x,∞,6))\operatorname{Normal}(\operatorname{Series}(\mathrm{HurwitzZeta}(2, x), x, ∞, 6))OutSeries⁡(HurwitzZeta(2,x),x,∞,6)\operatorname{Series}(\mathrm{HurwitzZeta}(2, x), x, ∞, 6)
Scope #

A positive integer aa peels off the first terms: ζ(7,5)=ζ(7)−∑k=14k−7\zeta(7, 5) = \zeta(7) - \sum_{k=1}^{4} k^{-7}

live ↗
InHurwitzZeta(7,5)\mathrm{HurwitzZeta}(7, 5)Outζ(7)−36 130 31535 831 808ζ(7)-\frac{36\,130\,315}{35\,831\,808}

Complex aa

live ↗
InN(HurwitzZeta(2.3,8+i))N(\mathrm{HurwitzZeta}(2.3, 8+i))Out0.054 470 082 732 130 67−0.009 448 515 336 470 249i0.054\,470\,082\,732\,130\,67-0.009\,448\,515\,336\,470\,249i

Listable: threads over a list of orders

live ↗
InHurwitzZeta([2,3,4],0.5)\mathrm{HurwitzZeta}(\bigl\lbrack2, 3, 4\bigr\rbrack, 0.5)Out[4.934 802 200 544 679,8.414 398 322 117 16,16.234 848 505 667 074]\bigl\lbrack4.934\,802\,200\,544\,679, 8.414\,398\,322\,117\,16, 16.234\,848\,505\,667\,074\bigr\rbrack

Uncertainty in aa

live ↗
InHurwitzZeta(2,Around(0.5,0.01))\mathrm{HurwitzZeta}(2, \mathrm{Around}(0.5, 0.01))OutAround(4.934 802 200 544 679,0.168 287 966 442 343 2)\mathrm{Around}(4.934\,802\,200\,544\,679, 0.168\,287\,966\,442\,343\,2)

ζ(2,1/2)=π2/2\zeta(2, 1/2) = \pi^2/2 -- the s=2s = 2 instance of ζ(s,1/2)=(2s−1)ζ(s)\zeta(s, 1/2) = (2^s-1)\zeta(s)

live ↗
InHurwitzZeta(2,12)\mathrm{HurwitzZeta}(2, \frac{1}{2})Outπ22\frac{π^2}{2}

ζ(2,1/4)=π2+8G\zeta(2, 1/4) = \pi^2 + 8G, with Catalan's constant GG

live ↗
InHurwitzZeta(2,14)\mathrm{HurwitzZeta}(2, \frac{1}{4})Out8G⁡+π28\operatorname{G}+π^2

To 30 significant digits, the last one correctly rounded

live ↗
InN(HurwitzZeta(3,13),30)N(\mathrm{HurwitzZeta}(3, \frac{1}{3}), 30)Out27.561 061 199 700 803 776 227 877 977 427.561\,061\,199\,700\,803\,776\,227\,877\,977\,4

Far left of the strip, all 40 digits agree with mpmath

live ↗
InN(HurwitzZeta(−412,310),40)N(\mathrm{HurwitzZeta}(-\frac{41}{2}, \frac{3}{10}), 40)Out136.361 935 791 831 144 171 775 099 936 398 861 428 6136.361\,935\,791\,831\,144\,171\,775\,099\,936\,398\,861\,428\,6
1 / 2

Left of the strip at a non-integer aa

live ↗
InN(HurwitzZeta(−20,0.7))N(\mathrm{HurwitzZeta}(-20, 0.7))Out−80.090 973 876 253 591 336 315 884 263 449 498 563 465 460 831 738 8-80.090\,973\,876\,253\,591\,336\,315\,884\,263\,449\,498\,563\,465\,460\,831\,738\,8

A negative aa: (−12)−5(-\tfrac12)^{-5} is real, and so is the answer

live ↗
InN(HurwitzZeta(5,−12))N(\mathrm{HurwitzZeta}(5, -\frac{1}{2}))Out0.144 760 409 444 467 716 2720.144\,760\,409\,444\,467\,716\,272

Fractional order and shift at fifty digits

live ↗
InN(HurwitzZeta(13,87),50)N(\mathrm{HurwitzZeta}(\frac{1}{3}, \frac{8}{7}), 50)Out−1.138 936 744 449 099 174 654 867 433 453 572 781 096 191 946 075 5-1.138\,936\,744\,449\,099\,174\,654\,867\,433\,453\,572\,781\,096\,191\,946\,075\,5

Threads over a matrix of shifts, giving Bernoulli-polynomial values

live ↗
InHurwitzZeta(−1,[[12,1],[1,12]])\mathrm{HurwitzZeta}(-1, \bigl\lbrack\bigl\lbrack\frac{1}{2}, 1\bigr\rbrack, \bigl\lbrack1, \frac{1}{2}\bigr\rbrack\bigr\rbrack)Out[[124,−112],[−112,124]]\bigl\lbrack\bigl\lbrack\frac{1}{24}, -\frac{1}{12}\bigr\rbrack, \bigl\lbrack-\frac{1}{12}, \frac{1}{24}\bigr\rbrack\bigr\rbrack

At a negative order it expands to a polynomial in aa

live ↗
InFunctionExpand(HurwitzZeta(−2,a))\mathrm{FunctionExpand}(\mathrm{HurwitzZeta}(-2, a))Out−a33+a22−a6-\frac{a^3}{3}+\frac{a^2}{2}-\frac{a}{6}

At order 0, ζ(0,a)=12−a\zeta(0,a)=\tfrac12-a

live ↗
InFunctionExpand(HurwitzZeta(0,a))\mathrm{FunctionExpand}(\mathrm{HurwitzZeta}(0, a))Out12−a\frac{1}{2}-a

Both eigenvalues give the same value, so the matrix is scalar

live ↗
InFullSimplify(MatrixFunction(()↦HurwitzZeta(−1,_1⁡),[[1/2,1],[1,1/2]]))\mathrm{FullSimplify}(\mathrm{MatrixFunction}(()↦\mathrm{HurwitzZeta}(-1, \operatorname{\_1}), \bigl\lbrack\bigl\lbrack1/2, 1\bigr\rbrack, \bigl\lbrack1, 1/2\bigr\rbrack\bigr\rbrack))Out[[−1124,0],[0,−1124]]\bigl\lbrack\bigl\lbrack-\frac{11}{24}, 0\bigr\rbrack, \bigl\lbrack0, -\frac{11}{24}\bigr\rbrack\bigr\rbrack
live ↗
InSeries⁡(HurwitzZeta(s,a),a,0,3)\operatorname{Series}(\mathrm{HurwitzZeta}(s, a), a, 0, 3)OutHurwitzZeta(s,0)−asHurwitzZeta(s+1,0)+12(s×(s+1)HurwitzZeta(s+2,0)a2)+16((−((s+2)HurwitzZeta(s+3,0)s2)−s×(s+2)HurwitzZeta(s+3,0))a3)+O(a4)\mathrm{HurwitzZeta}(s, 0)-as\mathrm{HurwitzZeta}(s+1, 0)+\frac{1}{2}(s×(s+1)\mathrm{HurwitzZeta}(s+2, 0)a^2)+\frac{1}{6}((-((s+2)\mathrm{HurwitzZeta}(s+3, 0)s^2)-s×(s+2)\mathrm{HurwitzZeta}(s+3, 0))a^3)+O\left(a^4\right)
Applications #

ζ(1/2,1/3)\zeta(1/2, 1/3) to 40 digits, proven: the Euler–Maclaurin remainder is bounded, and both ends of the enclosure round to these digits

live ↗
InN(HurwitzZeta(12,13),40)N(\mathrm{HurwitzZeta}(\frac{1}{2}, \frac{1}{3}), 40)Out−0.118 083 327 934 221 719 094 454 170 794 102 733 145 9-0.118\,083\,327\,934\,221\,719\,094\,454\,170\,794\,102\,733\,145\,9
Properties #

ζ(0,a)=12−a\zeta(0, a) = \tfrac12 - a -- exact and symbolic in aa

live ↗
InHurwitzZeta(0,a)\mathrm{HurwitzZeta}(0, a)Out12−a\frac{1}{2}-a

ζ(−1,a)=−B2(a)/2=−112(6a2−6a+1)\zeta(-1, a) = -B_2(a)/2 = -\tfrac{1}{12}(6a^2 - 6a + 1)

live ↗
InHurwitzZeta(−1,a)\mathrm{HurwitzZeta}(-1, a)Out−a22+a2−112-\frac{a^2}{2}+\frac{a}{2}-\frac{1}{12}

Pole at s=1s = 1 for every aa

live ↗
InHurwitzZeta(1,3)\mathrm{HurwitzZeta}(1, 3)Out∞~\tilde∞

ζ(s,1/2)=(2s−1)ζ(s)\zeta(s, 1/2) = (2^s - 1)\zeta(s) for symbolic ss

live ↗
InHurwitzZeta(s,12)\mathrm{HurwitzZeta}(s, \frac{1}{2})Out(2s−1)ζ(s)(2^{s}-1)ζ(s)

ζ(s,1)=ζ(s)\zeta(s, 1) = \zeta(s) for symbolic ss

live ↗
InHurwitzZeta(s,1)\mathrm{HurwitzZeta}(s, 1)Outζ(s)ζ(s)

ζ(0,a)=12−a\zeta(0, a) = \tfrac12 - a holds at a=0a = 0 too

live ↗
InHurwitzZeta(0,0)\mathrm{HurwitzZeta}(0, 0)Out12\frac{1}{2}

ζ(−2,a)=−B3(a)/3\zeta(-2, a) = -B_3(a)/3

live ↗
InHurwitzZeta(−2,a)\mathrm{HurwitzZeta}(-2, a)Out−a33+a22−a6-\frac{a^3}{3}+\frac{a^2}{2}-\frac{a}{6}

∂aζ(s,a)=−s ζ(s+1,a)\partial_a\zeta(s, a) = -s\,\zeta(s+1, a)

live ↗
IndHurwitzZeta(s,a)da\frac{\mathrm{d}\mathrm{HurwitzZeta}(s, a)}{\mathrm{d}a}Out−(sHurwitzZeta(s+1,a))-(s\mathrm{HurwitzZeta}(s+1, a))

ζ(4,2)=π4/90−1\zeta(4, 2) = \pi^4/90 - 1

live ↗
InHurwitzZeta(4,2)\mathrm{HurwitzZeta}(4, 2)Outπ490−1\frac{π^4}{90}-1

ζ(0)=−1/2\zeta(0)=-1/2

live ↗
InHurwitzZeta(0,1)\mathrm{HurwitzZeta}(0, 1)Out−12-\frac{1}{2}

Known value · Wolfram MathematicalFunctionData, HurwitzZeta

ζ(−1)=−1/12\zeta(-1)=-1/12

live ↗
InHurwitzZeta(−1,1)\mathrm{HurwitzZeta}(-1, 1)Out−112-\frac{1}{12}

Known value · Wolfram MathematicalFunctionData, HurwitzZeta

Shift 1/41/4 at order 0

live ↗
InHurwitzZeta(0,14)\mathrm{HurwitzZeta}(0, \frac{1}{4})Out14\frac{1}{4}

Known value · Wolfram MathematicalFunctionData, HurwitzZeta

A shifted value at order −1-1

live ↗
InHurwitzZeta(−1,14)\mathrm{HurwitzZeta}(-1, \frac{1}{4})Out196\frac{1}{96}

Known value · Wolfram MathematicalFunctionData, HurwitzZeta

ζ(2)\zeta(2) minus the first two terms

live ↗
InHurwitzZeta(2,3)\mathrm{HurwitzZeta}(2, 3)Outπ26−54\frac{π^2}{6}-\frac{5}{4}

Known value · Wolfram MathematicalFunctionData, HurwitzZeta

ζ(2)\zeta(2) minus the first three terms

live ↗
InHurwitzZeta(2,4)\mathrm{HurwitzZeta}(2, 4)Outπ26−4936\frac{π^2}{6}-\frac{49}{36}

Known value · Wolfram MathematicalFunctionData, HurwitzZeta

Shift 5 drops four terms of ζ(2)\zeta(2)

live ↗
InHurwitzZeta(2,5)\mathrm{HurwitzZeta}(2, 5)Outπ26−205144\frac{π^2}{6}-\frac{205}{144}

Known value · Wolfram MathematicalFunctionData, HurwitzZeta

Shift 6 drops five terms of ζ(2)\zeta(2)

live ↗
InHurwitzZeta(2,6)\mathrm{HurwitzZeta}(2, 6)Outπ26−5 2693 600\frac{π^2}{6}-\frac{5\,269}{3\,600}

Known value · Wolfram MathematicalFunctionData, HurwitzZeta

Shift 7 drops six terms of ζ(2)\zeta(2)

live ↗
InHurwitzZeta(2,7)\mathrm{HurwitzZeta}(2, 7)Outπ26−5 3693 600\frac{π^2}{6}-\frac{5\,369}{3\,600}

Known value · Wolfram MathematicalFunctionData, HurwitzZeta

Shift 8 drops seven terms of ζ(2)\zeta(2)

live ↗
InHurwitzZeta(2,8)\mathrm{HurwitzZeta}(2, 8)Outπ26−266 681176 400\frac{π^2}{6}-\frac{266\,681}{176\,400}

Known value · Wolfram MathematicalFunctionData, HurwitzZeta

Shift 9 drops eight terms of ζ(2)\zeta(2)

live ↗
InHurwitzZeta(2,9)\mathrm{HurwitzZeta}(2, 9)Outπ26−1 077 749705 600\frac{π^2}{6}-\frac{1\,077\,749}{705\,600}

Known value · Wolfram MathematicalFunctionData, HurwitzZeta

Shift 10 drops nine terms of ζ(2)\zeta(2)

live ↗
InHurwitzZeta(2,10)\mathrm{HurwitzZeta}(2, 10)Outπ26−9 778 1416 350 400\frac{π^2}{6}-\frac{9\,778\,141}{6\,350\,400}

Known value · Wolfram MathematicalFunctionData, HurwitzZeta

Reduces to ζ(4)=π4/90\zeta(4)=\pi^4/90

live ↗
InHurwitzZeta(4,1)\mathrm{HurwitzZeta}(4, 1)Outπ490\frac{π^4}{90}

Known value · Wolfram MathematicalFunctionData, HurwitzZeta

Possible issues #

ζ(−3,7/3)=−B4(7/3)/4=−7813/3240\zeta(-3, 7/3) = -B_4(7/3)/4 = -7813/3240, exact via the Bernoulli polynomial

live ↗
InHurwitzZeta(−3,73)\mathrm{HurwitzZeta}(-3, \frac{7}{3})Out−7 8133 240-\frac{7\,813}{3\,240}

A pole when the shift is a nonpositive integer

live ↗
InHurwitzZeta(2,−2)\mathrm{HurwitzZeta}(2, -2)Out∞~\tilde∞
About
Examples224
Checked againstWolfram Language 209 agree8 differ2 unevaluatedSageMath 173 agree4 differ6 errorSymPy 208 agree9 differ1 errormpmath 185 agree5 differ6 error
CrosswalkWikipediaMathWorldWikidataDLMFFungrimFungrim entry ×44Wolfram LanguageSageMathSymPympmath

Implementation

referenceenginenotatio

The Dirichlet series, on the principal branch — written exp(−s·ln(n+a)) so the wildcards arrive in the head's own order. It converges only for Re(s) > 1; everywhere else ζ(s, a) is its analytic continuation, which is what the kernel computes.

nativeenginetypescriptpackages/ce-patches/src/compute-engine/numerics/hurwitz-zeta.ts

Euler–Maclaurin in double precision — the fast path, and all a double holds. Asked for more digits than that, N() leaves it: at an integer s ≥ 2 with real a > 0 it takes ζ(n, a) = (−1)ⁿψ⁽ⁿ⁻¹⁾(a)/(n−1)! through compute-engine's PolyGamma, and otherwise (real s ≠ 1, real a > 0) it evaluates the SAME Euler–Maclaurin written as an expression — a finite Sum over Power, Pochhammer and BernoulliB, which compute-engine carries to whatever precision was asked for (packages/symbols/analysis/analytic/src/precise.ts).

compiledgpuwgslpackages/symbols/analysis/analytic/src/shader.ts:zetaWGSL

Produces a colour per pixel — complex ζ(s, a), domain-coloured.

mappedwolframpackages/oracle/src/mappings.ts

mpmath is correct at negative-integer s where Wolfram's N[] is not; the grid in special-functions.examples.json covers that branch.

mappedsympypackages/oracle/src/mappings.ts

mpmath is correct at negative-integer s where Wolfram's N[] is not; the grid in special-functions.examples.json covers that branch.

mappedmpmathpackages/oracle/src/mappings.ts

mpmath is correct at negative-integer s where Wolfram's N[] is not; the grid in special-functions.examples.json covers that branch.

mappedsagepackages/oracle/src/mappings.ts

mpmath is correct at negative-integer s where Wolfram's N[] is not; the grid in special-functions.examples.json covers that branch.

See also: Zeta, BernoulliB, Gamma, Digamma