Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I do the double sum using the sigma notation I get

$$1 + \sum_{n=0}^{\infty}\sum_{k = n}^{\infty} \frac{1}{(k+2)k!}$$

$1 + e - \cosh[1]$

When I do the sums as below, I get the expected answer.

1 + Sum[Sum[1/((k + 2) k!), {k, n, Infinity}], {n, 0, Infinity}]  


Why the difference?

Edit for those who might like to see the only identity I could find:

Defer[1 + Sum[Sum[1/((k + 1)! + k!), {k, n, Infinity}], {n, 0, Infinity}]]
share|improve this question
Could you explain what you mean by "doing" a sum "using the sigma notation"? – whuber Apr 22 '13 at 14:50
I guess he means this 1 + \!\( \*UnderoverscriptBox[\(\[Sum]\), \(n = 0\), \(\[Infinity]\)]\( \*UnderoverscriptBox[\(\[Sum]\), \(k = n\), \(\[Infinity]\)] \*FractionBox[\(1\), \(\((k + 1)\) \(k!\)\)]\)\). This by the way does not converge in Mathematica 9 and in place of 1 + e - Cosh[1] returns the input unchanged. The Sum version does converge to $\mathrm e$. – PlatoManiac Apr 22 '13 at 14:54
This seems to work 1 + \!\( \*UnderoverscriptBox[\(\[Sum]\), \(n = 0\), \(\[Infinity]\)]\(( \*UnderoverscriptBox[\(\[Sum]\), \(k = n\), \(\[Infinity]\)] \*FractionBox[\(1\), \(\((k + 2)\)\ \(k!\)\)])\)\) – user0501 Apr 22 '13 at 14:59
@whuber sigma, a Greek letter ;) – BoLe Apr 22 '13 at 14:59
The sigma notation is a red herring here. The difference is between 1 + Sum[Sum[1/((k + 2) k!), {k, n, Infinity}], {n, 0, Infinity}] and 1 + Sum[1/((k + 2) k!), {n, 0, Infinity}, {k, n, Infinity}] They should give the same answer but they don't. – Simon Woods Apr 22 '13 at 15:37
up vote 9 down vote accepted

You can use Defer to see how to properly enter your "summation" type notation.

Defer[1 + Sum[Sum[1/((k + 2) k!), {k, n, Infinity}], {n, 0, Infinity}]]

You can then enter that output to see that it works. You must've entered something different.

enter image description here

share|improve this answer
+1, I didn't put the () around the second sum. – Fred Kline Apr 22 '13 at 15:08
Sum[1/((k + 2)*k!), {n, 0, Infinity}, {k, n, Infinity}] takes forever time on my MMA 9. I think there might be something more here than just mis-input? – Silvia Apr 22 '13 at 16:50
@FredKline If reverse the iterators does the work, I'd call it a bug. And it doesn't work in version 9. – Silvia Apr 22 '13 at 17:27
@FredKline Please see my answer, especially the note at the end. – Silvia Apr 22 '13 at 17:48

I think it's because in the sigma form the two sums are treated as a double sum with different order as the expression case:

In==> $$ \text{Hold}[\sum _{n=0}^{\infty } \sum _{k=n}^{\infty } \frac{1}{(k+2) k!}]//\text{InputForm} $$ Out==>

Hold[Sum[1/((k + 2)*k!), {n, 0, Infinity}, {k, n, Infinity}]]

and according to the documentation, the sum for n will be evaluate first.

In multiple sums, the range of the outermost variable is given first.

So if we interchange the two sigma, it would work:

in==> $$ 1+\sum _{k=n}^{\infty } \sum _{n=0}^{\infty } \frac{1}{(k+2) k!} $$ out==> $$ e $$

I'm using version 8 on Mac. Here is a screen shot:

enter image description here

share|improve this answer
Curious, interchanging the sigmas doesn't work here ... (Mma 9 on win) – Dr. belisarius Apr 22 '13 at 15:14
Pretty much exactly the opposite of what I did - very cool! – Mark McClure Apr 22 '13 at 15:33
@belisarius, exchanging the iterators shouldn't work. The correct way round is for the outermost variable to be given first. Compare Sum[1,{i,1,2},{j,1,i}] with Sum[1,{j,1,i},{i,1,2}] – Simon Woods Apr 22 '13 at 15:46
@SimonWoods why do you say that? Could you point out where is wrong in my answer? – user0501 Apr 22 '13 at 16:04
Agree with Simon, the exchanging shouldn't work.(and it indeed does not work in my MMA 9.) By math notation convention, in nested summation, the most inner one (i.e. the rightest one) should be calculated first, as the range of any given iterator is restricted by every iterators to its left. (ref.) The nesting syntax of Sum is similar as Table. – Silvia Apr 22 '13 at 16:44

As we should expect the following identity (maybe under some certain mathematical assumptions, I'm not sure):

$$\sum _i \sum _j f(i,j)=\sum _i \left(\sum _j f(i,j)\right)\;\text{,}$$

which we can confirm in Mathematica 9 by the examples say:

enter image description here

However, the nested-iterator version of the summation in the original question takes forever time in my Mathematica 9:

Sum[1/((k + 2)*k!),
   {n, 0, Infinity}, {k, n, Infinity}]

while the nested-Sum version

    Sum[1/((k + 2)*k!),
       {k, n, Infinity}],
   {n, 0, Infinity}]

as Mark McClure said in answer above, and user0501 said in comment, evaluates quickly to 1 + E.

So for the " Why the difference? ", my guessing is maybe Mathematica uses different algorithms and strategies for this two different kind of summations, which eventually make the former one unable to reach the answer for OP's problem.


I believe it's a bug or something that in some Mathematica version exchanging the iterators works.

Have a look at the following snapshot taken from Mathematica 9:

enter image description here

The upper one, i.e. the iterator-exchanged one, has a lighter-green n under the most left $\sum$, which indicates it's a free global symbol, against the correct situation where it should be a iterator symbol with celadon colored. So $k$ gets wrongly out of the scope of $\sum_{n=0}^\infty$ here.

share|improve this answer
I see your point, that's cool to show that. By the way where do you get the second picture? – user0501 Apr 22 '13 at 17:52
+1 for the diagnostics. – Fred Kline Apr 22 '13 at 17:54
@user0501 It's in the preferences dialog box. – Silvia Apr 22 '13 at 17:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.