MathGroup Archive 2008

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

Search the Archive

Re: Summation question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg85708] Re: [mg85664] Summation question
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Tue, 19 Feb 2008 07:08:23 -0500 (EST)
  • Reply-to: hanlonr at cox.net

s = Prime /@ Range[6]

{2,3,5,7,11,13}

Total[f /@ s]

f(2)+f(3)+f(5)+f(7)+f(11)+f(13)

Plus @@ f /@ s

f(2)+f(3)+f(5)+f(7)+f(11)+f(13)

Sum[f[s[[i]]], {i, 6}]

f(2)+f(3)+f(5)+f(7)+f(11)+f(13)


Bob Hanlon

---- Robert Pigeon <robert.pigeon at videotron.ca> 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
> 
> 



  • Prev by Date: Re: Sterographic display
  • Next by Date: Re: Making a lists with conditions
  • Previous by thread: Re: Summation question
  • Next by thread: Re: Summation question