MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: strange errors for numerical evaluation of an infinite sum

  • To: mathgroup at smc.vnet.net
  • Subject: [mg58364] Re: [mg58322] strange errors for numerical evaluation of an infinite sum
  • From: Daniel Lichtblau <danl at wolfram.com>
  • Date: Tue, 28 Jun 2005 21:56:58 -0400 (EDT)
  • References: <200506280913.FAA05127@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Roger Bagula wrote:
> The Sum is:
> aa = Sum[1/(Prime[n + 1] - Prime[n])^PrimePi[n], {n, 1, Infinity}]
> The numerical evaluation is:
> N[aa]
> 
> The error is:
> \!\(\*
>    RowBox[{\(Prime::"intpp"\), \(\(:\)\(\ \)\), "\<\"Positive integer 
> argument
>        expected in \\!\\(
>        Prime[16.`]\\). \\!\\(\\*ButtonBox[\\\"More?\\\", \
> ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \
> ButtonData:>\\\"Prime::intpp\\\"]\\)\"\>"}]\)
> 
> and:
> 
> \!\(\*
>    RowBox[{\(General::"stop"\), \(\(:\)\(\ \)\), "\<\"Further output
>      of \\!\\(Prime :: \\\"intpp\\\"\\) will be suppressed during this \
> calculation. \\!\\(\\*ButtonBox[\\\"More?\\\", \
> ButtonStyle->\\\"RefGuideLinkText\\\", ButtonFrame->None, \
> ButtonData:>\\\"General::stop\\\"]\\)\"\>"}]\)
> 
> I got a slightly better answer by extending: $MaxExtraPrescision
> but I'm only getting a number to 19 places , it appears.
> 
> Any help will be appreciated. It seem to be some kind of frequency 
> number associated with the Primes.
> I don't know if it is a new constant or not.
> 
> Respectfully,
> Roger L. Bagula


Sum it to a finite bound.

In[1]:= aa[j_] := Sum[1/(Prime[n + 1] - Prime[n])^PrimePi[n], {n, j}]

In[2]:= N[aa[10000]]
Out[2]= 2.1168

It is not too hard to bound the error.  The base of the denominator is 
always at least 2 (and at most Prime[n] which is again easy to bound), 
and PrimePi[n] has asymptotic behavior that is easy to estimate 
sufficiently closely for this purpose.

Daniel Lichtblau
Wolfram Research


  • Prev by Date: Re: Optimal number of sheets
  • Next by Date: Re: A ToExpression question
  • Previous by thread: strange errors for numerical evaluation of an infinite sum
  • Next by thread: Minimal maximum eigenvalue in closed form?