You can slightly accelerate convergence using the asymptotics of the remainder: f[n_] := Total[N[Table[1/(Prime[k]^2 - 1), {k, 1, n}], 20]] g[n_] := (2 n Log[2 n]^2 f[2 n] - n Log[n]^2 f[n])/(2 n Log[2 n]^2 - n Log[n]^2 ) f[1000000] 0.55169329396767431759 (8 digits) g[1000000] 0.5516932976276071989 (10 digits) -Veit
On Nov 29, 2014, at 9:25 AM, Michael Kleber <michael.kleber@gmail.com> wrote:
Dan: Of course you asked it to invoke floating-point arithmetic, that's what NSum[] does.
You can try to get around that explicitly, like this:
In[1]:= NSum[1/(Prime[Round[k]]^2 - 1), {k,1,Infinity}]
Now the error message gives more insight into what it's thinking:
NIntegrate::slwcon: Numerical integration converging too slowly; suspect one of the following: singularity, value of the integration is 0, highly oscillatory integrand, or WorkingPrecision too small.
NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in k near {k} = {64.724}. NIntegrate obtained 0.00369981 and 5.43559 10^-6 for the integral and error estimates.
Prime::intpp: Positive integer argument expected in Prime[16.].
-2. Prime[Round[k]] Prime'[Round[k]] Round'[k] NSum::nsnum: Summand (or its derivative) ---------------------------------------------- is not numerical at point k = 16. 2 2 (-1. + Prime[Round[k]] )
1 Out[1]= NSum[--------------------, {k, 1, Infinity}] 2 Prime[Round[k]] - 1
If you just want it to add up the damn numbers, you can always
In[2]:= Plus @@ N[Table[1/(Prime[k]^2-1), {k,1,10000000}],20] Out[2]= 0.55169329737778261329
--Michael
On Sat, Nov 29, 2014 at 12:01 AM, Dan Asimov <dasimov@earthlink.net> wrote:
That is, .55168 .
On Nov 28, 2014, at 8:53 PM, Dan Asimov <dasimov@earthlink.net> wrote:
(The actual value is about .55618 .)
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
-- Forewarned is worth an octopus in the bush. _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun