Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Double sum

Hello,

I would like SAGE to compute a double sum like $\sum\limits_{1\le a\le n}\sum\limits_{1\le b\le n} \max(a,b)$. The result is strange :

f(n)=sum(sum(max(a,b),b,1,n),a,1,n)

SAGE tells me that f(2) is 6. But it is rather 7 (unless i am very tired).

Thank you for your advices :-)

Pierre