MathGroup Archive 2004

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

Search the Archive

Re: Conditonal sum

  • To: mathgroup at
  • Subject: [mg50269] Re: [mg50263] Conditonal sum
  • From: "David Park" <djmp at>
  • Date: Tue, 24 Aug 2004 06:22:03 -0400 (EDT)
  • Sender: owner-wri-mathgroup at


Is this what you mean?

Sm = {1, 3, 4, 7, 11};

a + Plus @@ Sm
26 + a


Fold[Plus, a, Sm]
26 + a

David Park
djmp at

From: Christopher Grinde [mailto:christopher.grinde at]
To: mathgroup at

I am new to mathematica and could really need a tip on how to implement a
conditional sum.  Pseudocode would be something like this

if j in Sm:

I have tried doing this by using an If-clause inside the sum-function, but

this seems little elegant and is nor very suitable for symbolic

Any advice would be highly appreciated

Christopher Grinde

  • Prev by Date: Selecting cubic roots in functional form
  • Next by Date: Re: Conditonal sum
  • Previous by thread: Conditonal sum
  • Next by thread: Re: Conditonal sum