MathGroup Archive 2003

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

Search the Archive

Re: Summations with Primes


There are two options:
If you want the primes Prime[i1] through Prime[i2] then use
Sum[f[Prime[i]],{i,i1,i2}]
The problem is that you'll need to find the appropriate i1,i2 so that
imin<=Prime[i1]<Prime[i2]<=imax.

Second approach is:
Sum[If[PrimeQ[i],f[i],0],{i,imin,imax}]

Orestis

"Anthony Felder" <afelder at crsi.org> wrote in message news:<b4mnus$imf$1 at smc.vnet.net>...
> Can you tell me if, when calculating a summation of f(i) where i goes from
> imin to imax, Mathematica can be forced to only use prime values for i?
> 
> Thank you for your time
> 
> Anthony Felder


  • Prev by Date: Re: Summations with Primes
  • Next by Date: Re: Summations with Primes
  • Previous by thread: Re: Summations with Primes
  • Next by thread: Re: Summations with Primes