MathGroup Archive 2012

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

Search the Archive

Re: Sum command


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
>



  • 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