I'm fairly new to Maple, so please correct me if I'm doing something incorrectly. However, I've uncovered some disturbing behaviour in how the Maple 10 engine finds the closed form of summations containing conditional statements.
For example, consider the following statements:
1) sum(`if`(k=0,n,binomial(n,k)),k=0..n); => 2^n
2) n + sum(binomial(n,k),k=1..n) => n - 1 + 2^n
The statements should be equivalent. However, Maple 10 returns an incorrect closed form for the first one. Similarly, define the following function:
g(3,0) + g(3,1) + g(3,2); => 21
g(3,0) + sum(g(3,x),x=1..2); => 21
sum(g(3,y),y=0..2) => 27
I'd be happy if someone could point me to an alternate way to encode conditional statements such that summations work correctly. What disturbs me is not that Maple can't handle this, but that it returns incorrect answers without any warnings...