Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Multiple Sums in Mathematica

  • To: mathgroup at
  • Subject: [mg53704] Re: [mg53696] Multiple Sums in Mathematica
  • From: Bob Hanlon <hanlonr at>
  • Date: Mon, 24 Jan 2005 03:37:25 -0500 (EST)
  • Reply-to: hanlonr at
  • Sender: owner-wri-mathgroup at

Presumably, you intend f to be a function of the indices.

multiSum[f_, n_Integer, maxIndex_:M, index_String:"i"]  :=


Sum[f[i1, i2, i3], {i1, 1, M}, {i2, 1, M}, {i3, 1, M}]


Sum[f[i1, i2, i3], {i1, 1, r}, {i2, 1, r}, {i3, 1, r}]


Sum[f[k1, k2, k3], {k1, 1, M}, {k2, 1, M}, {k3, 1, M}]

Bob Hanlon

> From: sbrandt at (Sebastian Brandt)
To: mathgroup at
> Date: 2005/01/23 Sun AM 02:02:26 EST
> To: mathgroup at
> Subject: [mg53704] [mg53696] Multiple Sums in Mathematica
> Hello,
> I want to perform a nested sum, where the number of summations is not
> specified. I.e., I am looking for a way to implement the sum
> sum[ f, {i1, 1, M}, {i2, 1, M}, ..., {in, 1, M} ]
> Does anbody know how to do this for arbitrary n?
> Regards,
> Sebastian Brandt

  • Prev by Date: Re: Problems with ExtendGraphics/Delaunay Triangulation
  • Next by Date: Re: Numbers and their reversals
  • Previous by thread: Re: Multiple Sums in Mathematica
  • Next by thread: Re: Multiple Sums in Mathematica