Comment #4 on issue 2691 by [email protected]: Runtime of double sums
http://code.google.com/p/sympy/issues/detail?id=2691

The denested one gives 0 because evaluation of the first sum gives 0:

s1
Sum((-1)**j*2**(-k)*I**(-k)*(-2*j + k)**(2*n + 1)*binomial(k, j)/k, (j, 0, k))
s1.subs(n,1).doit()
0

If we pull out the expression and do the sum manually we get zero sometimes, but not all the time:

a = s1.function.subs(n, 1)
kk=0;Add(*[a.subs(k,kk).subs(j,i) for i in range(kk+1)])
nan
kk=1;Add(*[a.subs(k,kk).subs(j,i) for i in range(kk+1)])
-I
kk=2;Add(*[a.subs(k,kk).subs(j,i) for i in range(kk+1)])
0
kk=3;Add(*[a.subs(k,kk).subs(j,i) for i in range(kk+1)])
2*I
kk=4;Add(*[a.subs(k,kk).subs(j,i) for i in range(kk+1)])
0
kk=5;Add(*[a.subs(k,kk).subs(j,i) for i in range(kk+1)])
0
kk=6;Add(*[a.subs(k,kk).subs(j,i) for i in range(kk+1)])
0
kk=7;Add(*[a.subs(k,kk).subs(j,i) for i in range(kk+1)])
0

So perhaps the first step is to figure out why that is giving 0 for the sum over (j, 0, k).

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to