#ifndef `NNDECLH'
#define NNDECLH "1"
*
*	Include file for declarations for harmonic summation program SUMMER
*
*	Parameters:
*	MAXWEIGHT: the maximum number of nested sums/ maximum weight
*	           sometimes the maximum number of indices of the R in S(R(),n)
*              sometimes the maximum value of the absolute value of the indices
*	File by J. Vermaseren
*
#define MAXWEIGHT "10"
*
*	First some automatic declarations. This way we do not have to worry how
*	many j1, j2, etc and S1, S2 etc. have been declared.
*	When a ifac8 or something like it will be encountered it will be
*	automatically declared as a CommutingFunction if it did not exist yet.
*
AutoDeclare Symbols i,j,k,l,m,n,x;
AutoDeclare CF sum,sign,bino,fac,ifac,invfac,num,den,S,theta,delta,Gamma,InvGamma;
*
*	Now the fixed declarations.
*
S	k,n,N,a;
CF	f,f1,f2,f3,f4,R,RR,T,TT,X,Y;
CF	Conj,Conjp,rep,pow,ipow,epow,acc,acc1,G,GG,InvG,Num,Den,Even,Odd;
S	y,xsum,z1,...,z`MAXWEIGHT',ln2;
*
*	Some sets are needed for generating the sums in the mellin programs
*	(and other programs as well)
*
Set ii:i1,...,i`MAXWEIGHT';
Set jset:j1,...,j`MAXWEIGHT';
Set sumset:sum1,...,sum`MAXWEIGHT';
Set denset:den1,...,den`MAXWEIGHT';
Set Sset:S1,...,S`MAXWEIGHT';
Set signset:sign1,...,sign`MAXWEIGHT';
Set zz:z1,...,z`MAXWEIGHT';
*
*	The powsum tables are to be used in more complete versions of the
*	summation program summit.prc
*
*	Sum table: powsum(k,n) = sum_(j,1,n,j^k)
*
CTable powsum(0:10,n?);
Fill powsum(0) = n;
Fill powsum(1) = n*(n+1)/2;
Fill powsum(2) = n*(n+1)*(2*n+1)/6;
Fill powsum(3) = n^2*(n+1)^2/4;
Fill powsum(4) = n*(n+1)*(2*n+1)*(3*n^2+3*n-1)/30;
Fill powsum(5) =-1/12*n^2+5/12*n^4+1/2*n^5+1/6*n^6;
Fill powsum(6) =1/42*n-1/6*n^3+1/2*n^5+1/2*n^6+1/7*n^7;
Fill powsum(7) =1/12*n^2-7/24*n^4+7/12*n^6+1/2*n^7+1/8*n^8;
Fill powsum(8) =-1/30*n+2/9*n^3-7/15*n^5+2/3*n^7+1/2*n^8+1/9*n^9;
Fill powsum(9) =-3/20*n^2+1/2*n^4-7/10*n^6+3/4*n^8+1/2*n^9+1/10*n^10;
Fill powsum(10)=5/66*n-1/2*n^3+n^5-n^7+5/6*n^9+1/2*n^10+1/11*n^11;
*
*	Sum table: mpowsum(k,n) = sum_(j,1,n,(-1)^j*j^k)
*
CTable mpowsum(0:10,n?);
Fill mpowsum(0) = (sign_(n)-1)/2;
Fill mpowsum(1) = ((2*n+1)*sign_(n)-1)/4;
Fill mpowsum(2) = n*(n+1)*sign_(n)/2;
Fill mpowsum(3) = ((4*n^3+6*n^2-1)*sign_(n)+1)/8;
Fill mpowsum(4) = n*(n+1)*(n^2+n-1)*sign_(n)/2;
Fill mpowsum(5) = ((2*n^5+5*n^4-5*n^2+1)*sign_(n)-1)/4;
Fill mpowsum(6) = n*(n+1)*(n^4+2*n^3-2*n^2-3*n+3)*sign_(n)/2;
Fill mpowsum(7) = ((8*n^7+28*n^6-70*n^4+84*n^2-17)*sign_(n)+17)/16;
Fill mpowsum(8) = n*(n+1)*(n^6+3*n^5-3*n^4-11*n^3+11*n^2+17*n-17)*sign_(n)/2;
Fill mpowsum(9) = ((2*n^9+9*n^8-42*n^6+126*n^4-153*n^2+31)*sign_(n)-31)/4;
Fill mpowsum(10)= n*(n+1)*(n^8+4*n^7-4*n^6-26*n^5+26*n^4+100*n^3-100*n^2-155*n+155)*sign_(n)/2;
*
*	The next two tables are for speed purposes only.
*
*	powsum1(k,n) = sum_(j,1,n-1,j^k)
*
CTable powsum1(0:10,n?);
Fill powsum1(0) = -1+n;
Fill powsum1(1) = -1/2*n+1/2*n^2;
Fill powsum1(2) = 1/6*n-1/2*n^2+1/3*n^3;
Fill powsum1(3) = 1/4*n^2-1/2*n^3+1/4*n^4;
Fill powsum1(4) = -1/30*n+1/3*n^3-1/2*n^4+1/5*n^5;
Fill powsum1(5) =-1/12*n^2+5/12*n^4-1/2*n^5+1/6*n^6;
Fill powsum1(6) =1/42*n-1/6*n^3+1/2*n^5-1/2*n^6+1/7*n^7;
Fill powsum1(7) =1/12*n^2-7/24*n^4+7/12*n^6-1/2*n^7+1/8*n^8;
Fill powsum1(8) =-1/30*n+2/9*n^3-7/15*n^5+2/3*n^7-1/2*n^8+1/9*n^9;
Fill powsum1(9) =-3/20*n^2+1/2*n^4-7/10*n^6+3/4*n^8-1/2*n^9+1/10*n^10;
Fill powsum1(10)=5/66*n-1/2*n^3+n^5-n^7+5/6*n^9-1/2*n^10+1/11*n^11;
*
*	mpowsum1(k,n) = sum_(j,1,n-1,(-1)^j*j^k)
*
CTable mpowsum1(0:10,n?);
Fill mpowsum1(0) = -1/2-1/2*sign_(n);
Fill mpowsum1(1) = -1/4+1/4*sign_(n)-1/2*sign_(n)*n;
Fill mpowsum1(2) = 1/2*sign_(n)*n-1/2*sign_(n)*n^2;
Fill mpowsum1(3) = 1/8-1/8*sign_(n)+3/4*sign_(n)*n^2-1/2*sign_(n)*n^3;
Fill mpowsum1(4) = -1/2*sign_(n)*n+sign_(n)*n^3-1/2*sign_(n)*n^4;
Fill mpowsum1(5) = -1/4+1/4*sign_(n)-5/4*sign_(n)*n^2+5/4*sign_(n)*n^4
                  -1/2*sign_(n)*n^5;
Fill mpowsum1(6) = 3/2*sign_(n)*n-5/2*sign_(n)*n^3+3/2*sign_(n)*n^5
                  -1/2*sign_(n)*n^6;
Fill mpowsum1(7) = 17/16-17/16*sign_(n)+21/4*sign_(n)*n^2-35/8*sign_(n)*n^4
                  +7/4*sign_(n)*n^6-1/2*sign_(n)*n^7;
Fill mpowsum1(8) = -17/2*sign_(n)*n+14*sign_(n)*n^3-7*sign_(n)*n^5
                  +2*sign_(n)*n^7-1/2*sign_(n)*n^8;
Fill mpowsum1(9) = -31/4+31/4*sign_(n)-153/4*sign_(n)*n^2+63/2*sign_(n)*n^4
                  -21/2*sign_(n)*n^6+9/4*sign_(n)*n^8-1/2*sign_(n)*n^9;
Fill mpowsum1(10) = 155/2*sign_(n)*n-255/2*sign_(n)*n^3+63*sign_(n)*n^5
                  -15*sign_(n)*n^7+5/2*sign_(n)*n^9-1/2*sign_(n)*n^10;
#endif

