Skip to content

StieltjesGamma ​

The Stieltjes constants γn\gamma_n, the coefficients of the Laurent expansion of ζ(s)\zeta(s) at s=1s = 1: ζ(s)=1s−1+∑n≥0(−1)nn!γn(s−1)n\zeta(s) = \dfrac{1}{s-1} + \sum_{n\ge0} \dfrac{(-1)^n}{n!}\gamma_n (s-1)^n; with a second argument, the generalized γn(a)\gamma_n(a) for HurwitzZeta.

✓ checked against that system · ! checked, with disagreements (hover a chip)WikipediaStieltjes constantsMathWorldStieltjesConstantsWikidataQ1816316DLMF25.2.E5FungrimStieltjesGamma✓Fungrim entryWolfram LanguageStieltjesGamma!
StieltjesGamma(n)the nn-th Stieltjes constant γn\gamma_n.
SageMathstieltjes(n)SymPystieltjes(n)mpmathstieltjes(n)
StieltjesGamma(n, a)the generalized Stieltjes constant γn(a)\gamma_n(a), from the expansion of ζ(s,a)\zeta(s, a) at s=1s = 1.
SymPystieltjes(n, a)mpmathstieltjes(n, a)
Typed signatures
TypePackageApplies
(integer, number?) -> numberanalyticreplaces compute-enginealways
(integer, number?) -> numbercompute-enginealways

Domain: Special functions

Details
  • γ0=γ=0.5772…\gamma_0 = \gamma = 0.5772\ldots is Euler's constant; γ1=−0.0728158…\gamma_1 = -0.0728158\ldots, γ2=−0.0096903…\gamma_2 = -0.0096903\ldots. They have no closed forms beyond γ0\gamma_0.
  • γn=lim⁡m→∞(∑k=1mln⁡nkk−ln⁡n+1mn+1)\gamma_n = \lim_{m\to\infty}\left(\sum_{k=1}^m \dfrac{\ln^n k}{k} - \dfrac{\ln^{n+1} m}{n+1}\right); for n=0n = 0 this is the definition of Euler's constant.
  • Generalized: ζ(s,a)=1s−1+∑n(−1)nn!γn(a)(s−1)n\zeta(s, a) = \dfrac{1}{s-1} + \sum_n \dfrac{(-1)^n}{n!}\gamma_n(a)(s-1)^n, so γn(1)=γn\gamma_n(1) = \gamma_n and γ0(a)=−ψ(a)\gamma_0(a) = -\psi(a), the negated digamma. Shift: γn(a+1)=γn(a)−ln⁡n(a)/a\gamma_n(a+1) = \gamma_n(a) - \ln^n(a)/a. Poles at a=0,−1,−2,…a = 0, -1, -2, \dots.
  • Same normalisation as Wolfram's StieltjesGamma[n,a]\mathrm{StieltjesGamma}[n, a] and mpmath's stieltjes(n, a). Complex aa supported.
  • Numerically, Euler–Maclaurin on ln⁡n(x)/x\ln^n(x)/x. In double precision the partial sum and the subtracted ln⁡n+1\ln^{n+1} term cancel more and more with nn: about 10−1210^{-12} relative through n=15n = 15, 10−1010^{-10} at n=20n = 20, 10−810^{-8} at n=30n = 30 — and orders past 30 are left unevaluated rather than returned wrong.
  • Certified digits: for an integer order n≤30n \le 30 and an exact real a>0a > 0, N(γn(a),d)\mathrm{N}(\gamma_n(a), d) is proven. The Euler–Maclaurin remainder is bounded by integrating each coefficient of ∣f(2M)∣|f^{(2M)}| on its own: the usual "next term" bound needs f(2M)f^{(2M)} to keep one sign past the tail point, and for n≥1n \ge 1 it does not. See N.

Plot

Examples

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

γ0=γ\gamma_0 = \gamma, Euler's constant

live ↗
InStieltjesGamma(0)\mathrm{StieltjesGamma}(0)Outγγ

No closed form past γ0\gamma_0 — stays symbolic until N(), which gives −0.0728158…-0.0728158\ldots

live ↗
InStieltjesGamma(1)\mathrm{StieltjesGamma}(1)OutStieltjesGamma(1)\mathrm{StieltjesGamma}(1)

γ1(32)\gamma_1(\tfrac32) numerically — a floating-point argument asks for a number

live ↗
InStieltjesGamma(1,1.5)\mathrm{StieltjesGamma}(1, 1.5)Out0.032 834 680 314 949 40.032\,834\,680\,314\,949\,4

γ3(12)=−0.66742…\gamma_3(\tfrac12) = -0.66742\ldots

live ↗
InStieltjesGamma(3,0.5)\mathrm{StieltjesGamma}(3, 0.5)Out−0.667 424 273 711 379 8-0.667\,424\,273\,711\,379\,8

γ2(32)\gamma_2(\tfrac32)

live ↗
InStieltjesGamma(2,1.5)\mathrm{StieltjesGamma}(2, 1.5)Out0.007 958 447 383 888 0470.007\,958\,447\,383\,888\,047

γ1=−0.0728158…\gamma_1 = -0.0728158\ldots under N()

live ↗
InN(StieltjesGamma(1))N(\mathrm{StieltjesGamma}(1))Out−0.072 815 845 483 676 52-0.072\,815\,845\,483\,676\,52

The first Stieltjes constant γ1\gamma_1 to 50 digits

live ↗
InN(StieltjesGamma(1),50)N(\mathrm{StieltjesGamma}(1), 50)Out−0.072 815 845 483 676 724 860 586 375 874 901 319 137 736 338 334 338-0.072\,815\,845\,483\,676\,724\,860\,586\,375\,874\,901\,319\,137\,736\,338\,334\,338

A generalised Stieltjes constant at a=12a=\frac12 to 50 digits

live ↗
InN(StieltjesGamma(2,12),50)N(\mathrm{StieltjesGamma}(2, \frac{1}{2}), 50)Out0.968 864 475 220 290 711 421 711 062 323 780 654 182 598 044 760 420.968\,864\,475\,220\,290\,711\,421\,711\,062\,323\,780\,654\,182\,598\,044\,760\,42
Scope #

Complex aa

live ↗
InN(StieltjesGamma(2,1+i))N(\mathrm{StieltjesGamma}(2, 1+i))Out0.170 304 201 468 587 9+0.373 177 195 757 495 25i0.170\,304\,201\,468\,587\,9+0.373\,177\,195\,757\,495\,25i

Listable in the order nn: threads over a list

live ↗
InStieltjesGamma([1,2,3],0.5)\mathrm{StieltjesGamma}(\bigl\lbrack1, 2, 3\bigr\rbrack, 0.5)Out[−1.353 459 680 804 941 5,0.968 864 475 220 290 7,−0.667 424 273 711 380 7]\bigl\lbrack-1.353\,459\,680\,804\,941\,5, 0.968\,864\,475\,220\,290\,7, -0.667\,424\,273\,711\,380\,7\bigr\rbrack

Interval arithmetic in aa

live ↗
InStieltjesGamma(2,Interval(2.34,2.35))\mathrm{StieltjesGamma}(2, \mathrm{Interval}(2.34, 2.35))OutInterval(−0.067 241 280 355 087 15,−0.065 140 403 663 072 42)\mathrm{Interval}(-0.067\,241\,280\,355\,087\,15, -0.065\,140\,403\,663\,072\,42)

To 30 significant digits, past a double's reach

live ↗
InN(StieltjesGamma(1),30)N(\mathrm{StieltjesGamma}(1), 30)Out−0.072 815 845 483 676 724 860 586 375 874 9-0.072\,815\,845\,483\,676\,724\,860\,586\,375\,874\,9
Applications #

γ1\gamma_1 to 40 digits, proven: the Euler–Maclaurin remainder is bounded, and both ends of the enclosure round to these digits

live ↗
InN(StieltjesGamma(1),40)N(\mathrm{StieltjesGamma}(1), 40)Out−0.072 815 845 483 676 724 860 586 375 874 901 319 137 74-0.072\,815\,845\,483\,676\,724\,860\,586\,375\,874\,901\,319\,137\,74

γ2(1/3)\gamma_2(1/3) to 40 digits, proven the same way

live ↗
InN(StieltjesGamma(2,13),40)N(\mathrm{StieltjesGamma}(2, \frac{1}{3}), 40)Out3.619 163 909 618 963 629 887 182 216 185 941 703 2943.619\,163\,909\,618\,963\,629\,887\,182\,216\,185\,941\,703\,294
Properties #

γ0(a)=−ψ(a)\gamma_0(a) = -\psi(a), symbolically in aa

live ↗
InStieltjesGamma(0,a)\mathrm{StieltjesGamma}(0, a)Out−PolyGamma(0,a)-\mathrm{PolyGamma}(0, a)

γn(1)=γn\gamma_n(1) = \gamma_n: the two-argument form reduces to it

live ↗
InStieltjesGamma(1,1)\mathrm{StieltjesGamma}(1, 1)OutStieltjesGamma(1)\mathrm{StieltjesGamma}(1)

γ0(1)=−ψ(1)=γ\gamma_0(1) = -\psi(1) = \gamma -- PolyGamma(0, z) routes through Digamma(z) (#113), which has ψ(1)=−γ\psi(1) = -\gamma exactly

live ↗
InStieltjesGamma(0,1)\mathrm{StieltjesGamma}(0, 1)Outγγ

γ0(12)=−ψ(12)=γ+2ln⁡2\gamma_0(\tfrac12) = -\psi(\tfrac12) = \gamma + 2\ln 2, now that ψ(12)\psi(\tfrac12) itself has a closed form

live ↗
InStieltjesGamma(0,12)\mathrm{StieltjesGamma}(0, \frac{1}{2})Outγ+2ln⁡(2)γ+2\ln(2)

γ3(1)=γ3\gamma_3(1) = \gamma_3 — order 1 at a=1a=1 is just the ordinary Stieltjes constant.

live ↗
InStieltjesGamma(3,1)\mathrm{StieltjesGamma}(3, 1)OutStieltjesGamma(3)\mathrm{StieltjesGamma}(3)

The constants are tiny: γ10\gamma_{10} is positive and below 10−310^{-3}

live ↗
In0<StieltjesGamma(10)<10−30\lt\mathrm{StieltjesGamma}(10)\lt10^{-3}OutTrue\mathrm{True}
Possible issues #

γn(a)\gamma_n(a) has poles at the nonpositive integers, like ζ(s,a)\zeta(s, a)

live ↗
InStieltjesGamma(2,−1)\mathrm{StieltjesGamma}(2, -1)Out∞~\tilde∞

Orders past 30 stay unevaluated even under N(): the double-precision kernel cannot be trusted there

live ↗
InStieltjesGamma(40)\mathrm{StieltjesGamma}(40)OutStieltjesGamma(40)\mathrm{StieltjesGamma}(40)

With a=1a=1 it is the ordinary constant γ2\gamma_2

live ↗
InStieltjesGamma(2,1)\mathrm{StieltjesGamma}(2, 1)OutStieltjesGamma(2)\mathrm{StieltjesGamma}(2)

A symbolic index cannot be evaluated

live ↗
InN(StieltjesGamma(2n))N(\mathrm{StieltjesGamma}(2n))OutStieltjesGamma(2n)\mathrm{StieltjesGamma}(2n)

The index stays symbolic; only the shift becomes a float

live ↗
InN(StieltjesGamma(2n,32))N(\mathrm{StieltjesGamma}(2n, \frac{3}{2}))OutStieltjesGamma(2n,1.5)\mathrm{StieltjesGamma}(2n, 1.5)
About
Examples28
Checked againstWolfram Language 26 agree1 differSageMath 7 agree1 differ1 unevaluatedSymPy 21 agree4 differ2 unevaluated1 errormpmath 18 agree2 differ2 unevaluated1 error
CrosswalkWikipediaMathWorldWikidataDLMFFungrimFungrim entry ×8Wolfram LanguageSageMathSymPy ×2mpmath ×2

Implementation

primitive · numericirreducibly numeric — it evaluates rather than rewrites

nativeenginetypescriptpackages/ce-patches/src/compute-engine/numerics/stieltjes.ts
mappedexternalwolfram / mpmathpackages/oracle/src/mappings.ts

StieltjesGamma[n, a]; mpmath.stieltjes(n, a).

mappedsympypackages/oracle/src/mappings.ts
mappedsympypackages/oracle/src/mappings.ts
mappedmpmathpackages/oracle/src/mappings.ts
mappedmpmathpackages/oracle/src/mappings.ts
mappedsagepackages/oracle/src/mappings.ts

See also: Zeta, HurwitzZeta, EulerGamma, Digamma