# Problems with double Sum

I have some decent problems with performing a double summation. The Sum is as follows

Sum[
f[M[2, 1],M[2, 2]]
, {M[2, 1], -Border, Border}
, {M[2, 2], -Border, Border}
]


over some function f, and this summation gives me the right result. However I want to generalize this thing in the following way

Sum[
Sum[
f[M[2, 1],M[2, 2]]
, {M[2, i], -Border, Border}]
, {i, 1, 2}
]


which doesn't give me the right result and I cannot understand why. Can anybody tell me what is going wrong here and more importantly, how to make this generalized sum work?!

greets mike

I think what you need is

Sum[f[M[2, 1], M[2, 2]],
Evaluate[Sequence @@ Table[{M[2, i], -Border, Border}, {i, 1, 2}]]]

• Thank you very much! This worked out for me! – mkmk Jul 24 '19 at 12:10
• You're welcome. The usual way of giving thanks on StackExchange is to up-vote an answer and to check the tick mark to accept an answer. – Roman Jul 25 '19 at 5:46

Perhaps

Fold[Sum[#, {m[2, #2], -b, b}] &,  f[m[2, 1], m[2, 2]], {2, 1}]

TexForm @ %


$$\sum _{m(2,1)=-b}^b \left(\sum _{m(2,2)=-b}^b f(m(2,1),m(2,2))\right)$$