# Does anyone have a Mathematica implementation of the standard $\arg\zeta(s)$ function required to evaluate $S(T)$?

This question is related to my question Is there an elegant exact formula for the zeta zero counting function? on Math StackExchange.

Question: Does anyone have a Mathematica implementation of the standard $$\arg\zeta(s)$$ function required to evaluate the function $$S(T)=\frac{\Im\left(\log\zeta\left(\frac{1}{2}+i\,T\right)\right)}{\pi}=\frac{\arg\zeta\left(\frac{1}{2}+i\,T\right)}{\pi}$$?

I believe Mathematica truncates $$\arg\zeta(s)$$ to the interval $$(-\pi,\pi)$$ whereas evaluation of $$S(T)$$ requires an analytic continuation of $$\arg\zeta(s)$$.

The answer posted to my question on Math StackExchange implies the analytic continuation of $$\arg\zeta(s)$$ is derived from the analytic continuation of $$\log\zeta(s)$$ and the relationship $$\arg\zeta(s)=\Im(\log\zeta(s))$$. The reason I formulated this question in terms of $$\arg\zeta(s)$$ instead of $$\log\zeta(s)$$ is because Mathematica simplifies $$\Im(\log\zeta(s))$$ to $$\arg\zeta(s)$$ which initially led to me to believe $$\Im(\log\zeta(s))$$ is derived from $$\arg\zeta(s)$$.

The fact that Mathematica does not properly evaluate $$\log\zeta(s)$$ and $$\arg\zeta(s)$$ is a bit upsetting and disturbing to me. This also seems to imply Mathematica may not be properly evaluating many of the functions related to $$\zeta(s)$$ such as those listed at Zeta Functions & Polylogarithms. I've been evaluating many of these functions related to $$\zeta(s)$$ for about $$4\frac{1}{2}$$ years now and only recently became aware Mathematica is not evaluating all of these functions correctly.

Assuming the definitions of $$N(T)$$ and $$N_0(T)$$ in formulas (1) and (2) below, I've been told $$N_0(T)=N(T)\,\forall\,T\ne\Im(\rho)$$. This implies one can get a pretty good idea of what $$\arg\zeta(s)$$ looks like when evaluated along the critical line in the upper half-plane by evaluating formula (3) below.

(1) $$\quad N(T)=\sum\limits_{0<\Im(\rho)\le T} 1$$

(2) $$\quad N_0(T)=1+\frac{\vartheta(T)}{\pi}+\frac{\arg\left(\zeta\left(\frac12+i\,T\right)\right)}{\pi})$$

$$\qquad\qquad\quad\ =1+\frac{\vartheta(T)}{\pi}+\frac{\Im\left(\log\zeta\left(\frac12+i\,T\right)\right)}{\pi}$$

(3) $$\quad\arg\zeta\left(\frac{1}{2}+i\,T\right)=\pi\left(N(T)-\left(\frac{\vartheta(T)}{\pi}+1\right)\right),\quad T\ge 0\land T\ne\Im(\rho)$$

Figure (1) below illustrates the Mathematica evaluation of $$\text{Arg[Zeta[1/2+I T]}$$ in orange overlaid on formula (3) for $$\arg\zeta\left(\frac{1}{2}+i\,T\right)$$ in blue in the interval $$0. The two dashed horizontal reference lines are at $$\pm \pi$$. Note the two evaluations are pretty much exactly the same in this interval except where $$T=\Im(\rho)$$ which I believe is because Mathematica does not truncate $$\arg\zeta\left(\frac{1}{2}+i\,T\right)$$ in this interval. Figure (1): Mathematica evaluation of $$\text{Arg[Zeta[1/2+I T]}$$ (orange) overlaid on formula (3) for $$\arg\zeta\left(\frac{1}{2}+i\,T\right)$$ (blue)

Figure (2) below illustrates the Mathematica evaluation of $$\text{Arg[Zeta[1/2+I T]}$$ in orange overlaid on formula (3) for $$\arg\zeta\left(\frac{1}{2}+i\,T\right)$$ in blue near Gram point $$g_{126}$$ and $$\Im\left(\rho_{127}\right)$$ where Gram's law is violated. The two dashed horizontal reference lines are at $$\pm \pi$$. Note Mathematica truncates $$\arg\zeta\left(\frac{1}{2}+i\,T\right)$$ to the interval $$(-\pi,\pi)$$ which is apparently inconsistent with the analytic continuation of $$\log\zeta(s)$$ and $$\arg\zeta(s)=\Im(\log\zeta(s))$$. The orange and red dots represent the discrete evaluation points $$(g_{126},\text{Arg[Zeta[1/2+I g_{126}])}$$ and $$\left(\Im\left(\rho_{127}\right),\arg\zeta\left(\frac{1}{2}+i\,\Im\left(\rho_{127}\right)\right)\right)$$ respectively. Figure (2): Mathematica evaluation of $$\text{Arg[Zeta[1/2+I T]}$$ (orange) overlaid on formula (3) for $$\arg\zeta\left(\frac{1}{2}+i\,T\right)$$ (blue)

Figure (3) below illustrates the Mathematica evaluation of $$\text{Arg[Zeta[1/2+I T]}$$ in orange overlaid on formula (3) for $$\arg\zeta\left(\frac{1}{2}+i\,T\right)$$ in blue near Gram point $$g_{6707}$$, $$\Im(\rho_{6709})$$, and $$\Im(\rho_{6710})$$ where Lehmer's Phenomenon is exhibited. The two dashed horizontal reference lines are at $$\pm \pi$$. Note Mathematica once again truncates $$\arg\zeta\left(\frac{1}{2}+i\,T\right)$$ to the interval $$(-\pi,\pi)$$. The orange dot represents the discrete evaluation point $$(g_{6707},\text{Arg[Zeta[1/2+I g_{6707}])}$$ and the two red dots represent the evaluation points $$\left(\Im\left(\rho_{6709}\right),\arg\zeta\left(\frac{1}{2}+i\,\Im\left(\rho_{6709}\right)\right)\right)$$ and $$\left(\Im\left(\rho_{6710}\right),\arg\zeta\left(\frac{1}{2}+i\,\Im\left(\rho_{6710}\right)\right)\right)$$. Figure (3): Mathematica evaluation of $$\text{Arg[Zeta[1/2+I T]}$$ (orange) overlaid on formula (3) for $$\arg\zeta\left(\frac{1}{2}+i\,T\right)$$ (blue)

• What is arg supposed to return when $\zeta(s)=0$? I'm unsure what "an analytic continuation of $\arg\zeta(s)$" is exactly. Arg is not a complex-analytic function. I'd guess that you want a smooth function $\Bbb R\rightarrow R$ that maps $T \mapsto \arg\zeta\left({1\over2}+T\right)$. I still think there has to be a discontinuity when the path of ${1\over2}+T$ passes through zero. I also think that if you want an arg that is not path-dependent, a simply connected domain for $s$ that excludes zeros needs to be specified. Am I missing something? – Michael E2 Feb 27 at 16:32
• @MichaelE2 I believe the answer posted to my question on Math StackExchange (see math.stackexchange.com/q/4037551) provides more insight. – Steven Clark Feb 27 at 16:51
• A related question. – J. M.'s torpor Feb 27 at 17:16
• A bit of caution seems in order due to Lehmer's phenomenon of closely-spaced pairs of ζ-zeros, which means that the phase jumps across the zeros are not always of the same sign. For an example, have a look at Plot[Arg[Zeta[1/2+I*t]]/Pi, {t, 7005, 7005.15}] close to the ζ-zero pair ZetaZero == 0.5 + 7005.06*I and ZetaZero == 0.5 + 7005.1*I: complementary phase jumps cause trouble. – Roman Feb 27 at 19:54
• @Roman The standard definition of $\arg\zeta(s)$ used in the evaluation of the function $S(T)=\frac{\arg\zeta\left(\frac{1}{2}+i\,T\right)}{\pi}$ is not the same as the Mathematica evaluation of "Arg[Zeta[s]]" which is my motivation for this question. – Steven Clark Feb 27 at 20:16