Re: Summations with Primes
- To: mathgroup at smc.vnet.net
- Subject: [mg39984] Re: Summations with Primes
- From: atelesforos at hotmail.com (Orestis Vantzos)
- Date: Thu, 13 Mar 2003 03:06:00 -0500 (EST)
- References: <b4mnus$imf$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
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