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 1999

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

Search the Archive

Re: Multiple sum with iterators that cannot equal

  • To: mathgroup at
  • Subject: [mg19590] Re: Multiple sum with iterators that cannot equal
  • From: Paul Abbott <paul at>
  • Date: Sat, 4 Sep 1999 01:34:26 -0400
  • Organization: University of Western Australia
  • References: <7pl714$>
  • Sender: owner-wri-mathgroup at

Eric Spahr wrote:

> Using  multiple summmation signs with condition 'i "not
> equal" j', evaluation stops immediately as 'i' starts as
> 1 as does 'j'.  My formula requires that the 'i's' and
> 'j's' together:
>         Sum[Sum[f,{j,1,n}],{i,1,n}] ignore cases where i = j.
>         Or as copied from my notebook:
> \!\(\(\(\[Sum]\+\(i = 1\)\%n\[Sum]\+\(j = 1\)\%n\)\+\(i
> != j\)\) \(w\_i\)
>     w\_j\)
> How do I solve this without some cumbersome loops.

Two suggestions:

[1] If there is no singularity if i==j then you could use

\!\(\[Sum]\+\(i = 1\)\%n\(\[Sum]\+\(j = 1\)\%n w\_i\ w\_j\) -
\[Sum]\+\(i = 1\)\%n w\_i\%2\)

[2] Alternatively,

\!\(\[Sum]\+\(i = 1\)\%n w\_i\ \((\[Sum]\+\(j = 1\)\%\(i - 1\)w\_j +
\[Sum]\+\(j = i + \
1\)\%n w\_j)\)\)

Paul Abbott                                   Phone: +61-8-9380-2734
Department of Physics                           Fax: +61-8-9380-1014
The University of Western Australia
Nedlands WA  6907                     mailto:paul at

            God IS a weakly left-handed dice player

  • Prev by Date: axes in ListPlot
  • Next by Date: Re: axes in ListPlot
  • Previous by thread: Re: axes in ListPlot
  • Next by thread: Re: Re: Multiple sum with iterators that cannot equal