Re: Summation question
- To: mathgroup at smc.vnet.net
- Subject: [mg85727] Re: Summation question
- From: David Bailey <dave at Remove_Thisdbailey.co.uk>
- Date: Wed, 20 Feb 2008 06:57:49 -0500 (EST)
- References: <fpdu7v$qlq$1@smc.vnet.net>
Robert Pigeon wrote: > Good day all, > > I want to make a summation like this: Sum[f[i],{i, start, > finish}]. What I want is that the sum be over a specific set like > {1,3,5,7,11,13}. So the sum would be : f[1]+f[3]+f[5]+f[7]+f[11]+f[13]. The > set I want to use is the primes. So, how do I use, if possible, Sum over a > specific set ? > > > > Thanks, > > > > Robert > > > > Robert Pigeon > > Given that you have a list of positions at which you want the sum - {1,3,5,7,11,13}, why not use Map, and then convert the resultant list to a summation: Plus @@ Map[f, {1, 3, 5, 7, 11, 13}] BTW, isn't 2 a prime too! David Bailey http://www.dbaileyconsultancy.co.uk
- Follow-Ups:
- Re: Re: Summation question
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Re: Re: Summation question