MathGroup Archive 2009

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

Search the Archive

Re: Is it possible to impose a condition on an iterator

  • To: mathgroup at smc.vnet.net
  • Subject: [mg101582] Re: [mg101499] Is it possible to impose a condition on an iterator
  • From: Oliver Ruebenkoenig <ruebenko at wolfram.com>
  • Date: Fri, 10 Jul 2009 06:48:41 -0400 (EDT)
  • References: <200907090552.BAA16854@smc.vnet.net>


Hello Mauro,

On Thu, 9 Jul 2009, Mauro wrote:

> I would like to perform a summation of this type,
>
> Sum[a^2 - 3 a/(4 a^2), {a, 1, 20}]
>
> excluding however some values of the iteratore, I would for instance
> like to exclude the values than to greater of 6 and inferior to 12. Is
> it possible?
>
> Thanks
>
>

how about:

f[a_] := If[6 <= a <= 12, 0, a^2 - 3 a/(4 a^2)]

Sum[f[a], {a, 1, 20}] ===
  Sum[a^2 - 3 a/(4 a^2), {a, 1, 5}] +
   Sum[a^2 - 3 a/(4 a^2), {a, 13, 20}]

Oliver


  • Prev by Date: Re: Jens-Peer Kuska passed away
  • Next by Date: Re: Manipulating list
  • Previous by thread: Is it possible to impose a condition on an iterator of the summation ?
  • Next by thread: Re: Is it possible to impose a condition on an iterator of