Skip to content

PrimeZetaP ​

The prime zeta function P(s)=∑pp−sP(s) = \sum_p p^{-s}, the sum over primes. Computed via the Möbius/ζ identity P(s)=∑k≥1μ(k)/k⋅ln⁡ζ(ks)P(s) = \sum_{k \ge 1} \mu(k)/k \cdot \ln\zeta(ks) rather than sieving primes directly — the identity converges geometrically, sieving does not.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguagePrimeZetaP✓
PrimeZetaP(s)P(s)P(s), for Re⁡(s)>0\operatorname{Re}(s) > 0.
Typed signatures
TypePackageApplies
(number) -> numberanalyticalways

Domain: Special functions

Details
  • Reuses this package's own Zeta (already extended to complex arguments) rather than a fresh prime-summation kernel; ln⁡ζ(ks)→0\ln\zeta(ks) \to 0 geometrically as kk grows, so the sum settles in a few dozen terms at double precision.
  • For Re⁡(s)≤1\operatorname{Re}(s) \le 1 the identity is an analytic continuation, and each ln⁡ζ(x)\ln\zeta(x), x=ksx = ks, takes Wolfram's branch: the principal logarithm when Re⁡(x)≥1/2\operatorname{Re}(x) \ge 1/2, and xln⁡2+(x−1)ln⁡π+Log⁡sin⁡(πx/2)+LogGamma⁡(1−x)+Log⁡ζ(1−x)x\ln 2 + (x-1)\ln\pi + \operatorname{Log}\sin(\pi x/2) + \operatorname{LogGamma}(1-x) + \operatorname{Log}\zeta(1-x) (the functional equation, each piece principal) when Re⁡(x)<1/2\operatorname{Re}(x) < 1/2. For real ss both are the principal logarithm, so Im⁡P(s)=π∑ks<1μ(k)/k\operatorname{Im} P(s) = \pi \sum_{ks < 1} \mu(k)/k. For complex ss the second differs from the first by a multiple of 2πi2\pi i that grows with Im⁡(s)\operatorname{Im}(s), and the value is not continuous across the real axis.
  • s=1/ks = 1/k for a squarefree kk is ComplexInfinity, as in Wolfram; 1/41/4 is finite because μ(4)=0\mu(4) = 0.
  • It declines (stays unevaluated) for Re⁡(s)≤0\operatorname{Re}(s) \le 0, at a zero of ζ(ks)\zeta(ks) and where ζ(ks)\zeta(ks) lies on the logarithm's cut, for Re⁡(s)\operatorname{Re}(s) below about 0.0050.005, and for ∣Im⁡(ks)∣>350|\operatorname{Im}(ks)| > 350 while Re⁡(ks)<1/2\operatorname{Re}(ks) < 1/2.
  • Checked against wolframscript's N[PrimeZetaP[s], 30] over a grid of real and complex ss in the strip, matching to 30 digits on the bignum path (where it answers) and to about 10−1210^{-12} at doubles.
  • N(x, d) past a double's digits runs the same sum on the BigDecimal ζ\zeta kernel, for real and complex ss, to dd digits; it declines at an approximated pole, and where the terms (about 3.4d/Re⁡(s)3.4 d/\operatorname{Re}(s)) would be too many.

Examples

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

∑p1/p2\sum_p 1/p^2

live ↗
InN(PrimeZetaP(2))N(\mathrm{PrimeZetaP}(2))Out0.452 247 420 041 065 50.452\,247\,420\,041\,065\,5

Known value · Wolfram 15.0.0 PrimeZetaP

live ↗
InN(PrimeZetaP(3))N(\mathrm{PrimeZetaP}(3))Out0.174 762 639 299 443 550.174\,762\,639\,299\,443\,55

Known value · Wolfram 15.0.0 PrimeZetaP

live ↗
InN(PrimeZetaP(2),50)N(\mathrm{PrimeZetaP}(2), 50)Out0.452 247 420 041 065 498 506 543 364 832 247 934 173 231 343 239 890.452\,247\,420\,041\,065\,498\,506\,543\,364\,832\,247\,934\,173\,231\,343\,239\,89
Scope #
live ↗
InPrimeZetaP(2.5)\mathrm{PrimeZetaP}(2.5)Out0.273 680 737 993 2340.273\,680\,737\,993\,234

Known value · Wolfram 15.0.0 PrimeZetaP

Re⁡(s)<1\operatorname{Re}(s) < 1: each ln⁡ζ(ks)\ln\zeta(ks) with ks<1ks < 1 is negative, so contributes ±iπμ(k)/k\pm i\pi\mu(k)/k, and Im⁡P=π(1−1/2)=π/2\operatorname{Im} P = \pi(1 - 1/2) = \pi/2

live ↗
InN(PrimeZetaP(411),50)N(\mathrm{PrimeZetaP}(\frac{4}{11}), 50)Out−1.435 100 337 745 163 433 710 852 727 776 389 558 234 430 910 384 8+1.570 796 326 794 896 619 231 321 691 639 751 442 098 584 699 687 6i-1.435\,100\,337\,745\,163\,433\,710\,852\,727\,776\,389\,558\,234\,430\,910\,384\,8+1.570\,796\,326\,794\,896\,619\,231\,321\,691\,639\,751\,442\,098\,584\,699\,687\,6i

P(3/10)P(3/10): Im⁡P=π(1−1/2−1/3)=π/6\operatorname{Im} P = \pi(1 - 1/2 - 1/3) = \pi/6

live ↗
InN(PrimeZetaP(310))N(\mathrm{PrimeZetaP}(\frac{3}{10}))Out−1.328 034 068 791 346 8+0.523 598 775 598 298 9i-1.328\,034\,068\,791\,346\,8+0.523\,598\,775\,598\,298\,9i

Known value · Wolfram 15.0.0 PrimeZetaP

ln⁡ζ(2s)\ln\zeta(2s) is infinite at s=1/2s = 1/2 and μ(2)=−1\mu(2) = -1

live ↗
InPrimeZetaP(12)\mathrm{PrimeZetaP}(\frac{1}{2})Out∞~\tilde∞

complex ss with Re⁡(s)<1/2\operatorname{Re}(s) < 1/2: Wolfram continues ln⁡ζ(s)\ln\zeta(s) through the functional equation, which puts Im⁡P\operatorname{Im} P at 5.425.42, 2π2\pi off the principal −0.86-0.86

live ↗
InN(PrimeZetaP(310+2i))N(\mathrm{PrimeZetaP}(\frac{3}{10}+2i))Out−0.469 945 293 401 886 95+5.420 612 621 861 013i-0.469\,945\,293\,401\,886\,95+5.420\,612\,621\,861\,013i

Known value · Wolfram 15.0.0 PrimeZetaP

Applications #
live ↗
InReplaceAll(γ+PrimeZetaP(1+exp⁡(−n))−n,[Rule(n,20)])\mathrm{ReplaceAll}(γ+\mathrm{PrimeZetaP}(1+\exp(-n))-n, \bigl\lbrack\mathrm{Rule}(n, 20)\bigr\rbrack)Out−20+γ+PrimeZetaP(1+e−20)-20+γ+\mathrm{PrimeZetaP}(1+e^{-20})
About
Examples12
Checked againstWolfram Language 12 agree
CrosswalkWolfram Language

Implementation

primitive · kernela kernel — an algorithm over mutable state that would not be readable as a tree

nativeenginetypescriptpackages/symbols/analysis/analytic/src/prime-zeta.ts

See also: Zeta