MathGroup Archive 2005

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

Search the Archive

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


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