# Range of summation in simple Plot seems off

I was trying to reproduce a picture in a book by Havil of the sum,

$$s = \sum_{r=1}^{\infty}\frac{\mu(r)}{r}\left(Li(x^{\rho_k/r})+Li(x^{\rho_k*/r})\right)$$

using

s = Sum[(MoebiusMu[i]/i)*(LogIntegral[x^(ZetaZero[1]/i)] +
LogIntegral[x^(Conjugate[ZetaZero[1]]/i)]), {i, 1, 30}];


The graph,

Plot[s, {x, 10, 100}]


looks qualitatively somewhat like the original for $k = 1$ but the range is too large and not as symmetric about $y = 0.$ The range, per Havil, is about $(-0.3, 0.3)$ as opposed to the range of about $(-3, 8)$ of the code above.

I tried increasing the number of terms but this doesn't seem to affect the picture much.

• I wonder if you could scan and post the formula and the plot (just that) Commented Aug 26, 2015 at 21:45
• Well, the output from Mma is quite asymmetric and in the (−3,8) range ... yes. Without access to the book IDT one can say more ... Commented Aug 26, 2015 at 22:07
• @belisarius: Perhaps not. Thanks for the edits and check of the range. If I get access to a scanner I will add the graphs. Or if someone who has the book can confirm that my description of the range is correct--the graph is on p. 198, upper left (his $T_1$). Commented Aug 26, 2015 at 22:16
• A tip I can give right now: you will want to use ExpIntegralEi[a Log[x]] here instead of LogIntegral[x^a]. Commented Aug 27, 2015 at 1:32

## 1 Answer

The function Txk[x,k,n] calculates the contribution of the k^th zero at position x. The parameter n governs how many terms in the sum are used. This corresponds to Havil's equation on the bottom of page 196 of his book Gamma. Note that ExpIntegralEi should be used as @J.M. suggests, and as discussed here. I think there is a typo in the book, hence the argument to ExpIntegralEi is divided by the summation index.

Txk[x_?NumericQ, k_Integer, n_Integer] :=
Module[{rlogx = ZetaZero[k]*Log[x],
mm = MoebiusMu[Range[n]], rn},
rn = Flatten[Position[mm, _?(# != 0 &)]];
-2*((mm[[rn]]/rn).Re[ExpIntegralEi[rlogx/rn]])]


For example, the following is the top row of plots on page 198.

Plot[Txk[x, 1, 100], {x, 10, 100}, Frame -> True,
AxesOrigin -> {0, 0}, FrameLabel -> {"x", ""},
PlotLabel -> "T[x,k=1]", BaseStyle -> {FontSize -> 14}]


• I think those plots also appeared in Wagon's book… Commented Aug 27, 2015 at 2:26
• Yes, these plots are on page 552 of the second edition of Mathematica in Action. The equation he uses is on page 549, which should have a minus sign in front. Equation (***) on top of page 550 is correct, and it includes a sum of 154 terms, which is an approximation justified by Riesel and Gohl, Mathematics of Computation, v24, p969, 1970. I think, but Stan may not agree with me, that in general the upper limit of the sum should be Floor[Log[2,x]]. Commented Aug 27, 2015 at 2:37
• The typo was in my question (in the formula but not the code), not the book. Corrected now. Helpful answer and references and tip. Commented Aug 27, 2015 at 3:32
• @daniel That's why I asked for the book scan. :( Commented Aug 27, 2015 at 5:34
• @daniel No problem. Glad to see you got a very nice answer! Commented Aug 27, 2015 at 7:29