Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: Sum command

  • To: mathgroup at smc.vnet.net
  • Subject: [mg128016] Re: Sum command
  • From: Bob Hanlon <hanlonr357 at gmail.com>
  • Date: Sun, 9 Sep 2012 05:09:06 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <20120908070808.4AD8D683B@smc.vnet.net>

iSum[expr_,
  {x_Symbol, xmin_, xmax_, xstep_Integer: 1}] :=
 Sum[expr, {x, Ceiling[xmin], Floor[xmax], xstep}]


iSum[f[i], {i, 7/2, 4}]

f[4]


iSum[f[i], {i, 3/2, 2}]

f[2]


iSum[f[i], {i, 1/2, 9/2}]

f[1] + f[2] + f[3] + f[4]


iSum[f[i], {i, 1/2, 9/2, 2}]

f[1] + f[3]


Bob Hanlon


On Sat, Sep 8, 2012 at 3:08 AM, Rodrigo AP <digorna at gmail.com> wrote:
>
> Dear group,
>
> How could I get: Sum[f[i],{i,7/2,4}]=f[4] or   Sum[f[i],{i,3/2,2}]=f[2] ? I
> mean, I want the iterator running over the integers only ...
>
> Regards
>
> --
> Rodrigo
>



  • References:
  • Prev by Date: Re: Count inside a matrix?
  • Next by Date: Re: Transforming/expanding a list
  • Previous by thread: Sum command
  • Next by thread: Re: Sum command