# What makes ListPlot better than N?

I wanted to numerically verify the validity of the formula for the first Stieltjes constant

$$\gamma_1=-\frac12\sum_{n=0}^\infty\frac1{n+1}\sum_{k=0}^n\binom{n}{k}(-1)^k\log^2(k+1)$$

 -1/2*Sum[1/(n + 1)*Sum[(-1)^k*Binomial[n, k]*Log[k + 1]^2, {k, 0, n}], {n, 0, Infinity}]


The correct value is

 StieltjesGamma//N
(* -0.0728158 *)


If I enter 40 terms of the series, the result is still OK

 N[-1/2*Sum[1/(n + 1)*Sum[(-1)^k*Binomial[n, k]*Log[k + 1]^2, {k, 0, n}], {n, 0, 40}]]
(* -0.0623308 *)


With 200 terms, however, the result runs away to wrong values

 N[-1/2*Sum[1/(n + 1)*Sum[(-1)^k*Binomial[n, k]*Log[k + 1]^2, {k, 0, n}], {n, 0, 200}]]
(* 3.28992*10^42 *)


However, if I use ListPlot, the graph for 200 terms (and even 400 terms!) is fine without having to enter any additional parameters.

 ListPlot[Table[-1/2*Sum[1/(n + 1)*Sum[(-1)^k*Binomial[n, k]*Log[k + 1]^2, {k, 0, n}], {n, 0, m}], {m, 1, 200}]] What is the problem? After all, ListPlot must also somehow calculate the values for the graph numerically. Does anyone know how to do this?

• Looks strange. Might it be a bug? – Αλέξανδρος Ζεγγ Jun 7 at 11:49
• I experimented with this representation of $\gamma_1$ some time back; I've found that this one (and the more general $\gamma_k$ expression this was derived from) has poor numerical properties. (I finally settled on using Abel-Plana instead.) Nevertheless: -NSum[(-1)^k*Binomial[n, k]*Log[k + 1]^2/(n + 1), {n, 0, ∞}, {k, 0, n}, Method -> {"WynnEpsilon", Degree -> 1, "ExtraTerms" -> 25}, NSumTerms -> 55, WorkingPrecision -> 45]/2 – J. M.'s technical difficulties Jun 7 at 12:01