MathGroup Archive 2005

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

Search the Archive

Re: Error: Prime::intpp: Positive integer argument expected in Prime[16.`]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg61913] Re: Error: Prime::intpp: Positive integer argument expected in Prime[16.`]
  • From: "antononcube" <antononcube at gmail.com>
  • Date: Fri, 4 Nov 2005 05:11:38 -0500 (EST)
  • References: <dk6vtg$gi1$1@smc.vnet.net><dk9vvh$6tm$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Sum cannot evaluate the summand it is given, so NSum is used.

Here is way to check that NSum gives reliable results:

(V6.0) In[113]:=
exact=Total@Table[1/2^Prime[n],{n,1,10}]
%//N//InputForm

(V6.0) Out[113]= 222630977/536870912

(V6.0) Out[114]//InputForm= 0.41468250937759876

(V6.0) In[107]:=
NSum[1/2^Prime[n],{n,1,\[Infinity]}]
NSum[1/2^Prime[n],{n,11,\[Infinity]}]
res=%%-%;
res//InputForm

During evaluation of (V6.0) In[107]:=
Prime::"intpp": "Positive integer argument expected in Prime[16.]."

During evaluation of (V6.0) In[107]:=
Prime::"intpp": "Positive integer argument expected in Prime[17.]."

During evaluation of (V6.0) In[107]:=
Prime::"intpp": "Positive integer argument expected in Prime[18.]."

During evaluation of (V6.0) In[107]:=
General::"stop": "Further output of Prime::"intpp" will be suppressed
during \
this calculation."

(V6.0) Out[107]= 0.414683

During evaluation of (V6.0) In[107]:=
Prime::"intpp": "Positive integer argument expected in Prime[26.]."

During evaluation of (V6.0) In[107]:=
Prime::"intpp": "Positive integer argument expected in Prime[27.]."

During evaluation of (V6.0) In[107]:=
Prime::"intpp": "Positive integer argument expected in Prime[28.]."

During evaluation of (V6.0) In[107]:=
General::"stop": "Further output of Prime::"intpp" will be suppressed
during \
this calculation."

(V6.0) Out[108]= 4.73513×10^(-10)

(V6.0) Out[110]//InputForm= 0.41468250937759876

(V6.0) In[112]:= exact-res//InputForm

(V6.0) Out[112]//InputForm= 0.


  • Prev by Date: Re: Question regarding Mathematica's treatment of whitespace
  • Next by Date: Re: ExportString[exp, "MathML"]
  • Previous by thread: Re: Error: Prime::intpp: Positive integer argument expected in Prime[16.`]
  • Next by thread: Re: pattern matching question