Exit[]

<<Sigma.m

The term algebra

Defining objects in Sigma

P=SigmaProduct[k,{k,1,n}]^2SigmaPower[-1,n]

E1=SigmaSum[SigmaFactorial[k],{k,1,n}]

GetFullDefinition[E1]

E1/.n->5

E2=SigmaSum[SigmaSum[1/i,{i,1,k}] SigmaSum[1/i^3,{i,1,k}]/(k+1),{k,1,n}]

E2/.n->4

E3=E1*(E1+E2)

E3/.n->4

E3=CollectProdSum[E3]

The problem SigmaReduce

A1=SigmaSum[SigmaSum[1/i,{i,1,k}]SigmaSum[1/i^3,{i,1,k}]/(k+1),{k,1,n}]

A2=(Underoverscript[(∑^(.)), (i=1), n])(1/(i^5))-(((Underoverscript[(∑^(.)), (i=1), n])(1/(i^4)))/(1+n))-(Underoverscript[(∑^(.)), (j=1), n])(((Underoverscript[(∑^(.)), (i=1), j])(1/(i^4)))/j)-(Underoverscript[(∑^(.)), (j=1), n])(((Underoverscript[(∑^(.)), (i=1), j])(1/(i^3)))/(j^2))+(((Underoverscript[(∑^(.)), (j=1), n])(((Underoverscript[(∑^(.)), (i=1), j])(1/(i^3)))/j))/(1+n))-(Underoverscript[(∑^(.)), (j=1), n])(((Underoverscript[(∑^(.)), (i=1), j])(1/i))/(j^4))+(((Underoverscript[(∑^(.)), (j=1), n])(((Underoverscript[(∑^(.)), (i=1), j])(1/i))/(j^3)))/(1+n))+(Underoverscript[(∑^(.)), (k=1), n])(((Underoverscript[(∑^(.)), (j=1), k])(((Underoverscript[(∑^(.)), (i=1), j])(1/(i^3)))/j))/k)+(Underoverscript[(∑^(.)), (k=1), n])(((Underoverscript[(∑^(.)), (j=1), k])(((Underoverscript[(∑^(.)), (i=1), j])(1/i))/(j^3)))/k);

{A1,A2}/.n->4

{B1,B2}=SigmaReduce[{A1,A2},n]

W=Complement[Variables[NShift[{B1,B2},n]],{n}]

{B2,B1}=SigmaReduce[{A2,A1},n]

W=Complement[Variables[NShift[{B1,B2},n]],{n}]

SigmaReduce[A2-A1,n]

varL=Append[Variables[A2],A1]

varLRed=SigmaReduce[varL,n]

MapThread[Rule,{varL,varLRed}]//MatrixForm

Symbolic summation in action

Toy examples

Telescoping

mySum=SigmaSum[S[1,k],{k,1,n}]

SigmaReduce[mySum]

mySum=SigmaSum[SigmaFactorial[k] k,{k,a,b}]

SigmaReduce[mySum]

mySum=SigmaSum[SigmaPower[-1,k] SigmaBinomial[n,k] SigmaHNumber[k],{k,a,b}]

SigmaReduce[mySum]

mySum=SigmaSum[SigmaSum[SigmaBinomial[n,k],{k,0,r}]^2,{r,0,b}]

res=SigmaReduce[mySum]

{mySum-res}/.{b->10}//Together

Definite summation

mySum=SigmaSum[SigmaHNumber[k]^2 SigmaBinomial[n,k],{k,0,n}]

SigmaReduce[mySum]

rec=GenerateRecurrence[mySum]

recSol=SolveRecurrence[rec[[1]],SUM[n]]

FindLinearCombination[recSol,mySum,n,4]

The full machinery

<<EvaluateMultiSums.m

The warm-up example

summand=(j(Subscript[!, .]) k(Subscript[!, .]) N(Subscript[!, .]) (j+k+N)(Subscript[!, .]) (((2+2 j+k+N)/((1+j+k) (1+j+N)))-S[1,j]+S[1,j+k]+S[1,j+N]-S[1,j+k+N]))/((1+j+k)(Subscript[!, .]) (1+j+N)(Subscript[!, .]) (1+k+N)(Subscript[!, .]));

mySum=(Underoverscript[(∑^(.)), (k=0), ∞])(Underoverscript[(∑^(.)), (j=0), ∞])summand

EvaluateMultiSum[mySum,{},{N},{1},{Infinity}]

The triple sum

summand=(-1)^r (-j+n-2)! Binomial[j+1,r] r!/(-j+n+r)! (-1)^s Binomial[-j+n+r-2,s]/((n-s) (s+1))

res=EvaluateMultiSum[summand,{{s,0,-j+n+r-2},{r,0,j+1},{j,0,n-2}},{n},{2}]//Timing