#C11.txt, 2/22/2018, Experimental Mathematics (Rutgers, Spring 2018) Help:=proc():print(`PfE(E), DP(L1,L2,M), DerD(L,k) , Dpo(L,k), Reci(L,N)`): end: with(linalg): #PfE(inputs a list of the [e1,...en] and outputs p_n (implementing the det. expression in #Ian Macdoland's famous book Symmetric Polynomials (p. 28)) PfE:=proc(E) local i,j,n: n:=nops(E): det([seq( [i*E[i], seq(E[i-j],j=1..i-1),1, 0$(n-i-1)], i=1..n-1), [n*E[n], seq(E[n-j],j=1..n-1)]]): end: with(numtheory): #DP(L1,L2,M): inputs the first nops(L1) terms of a Dirichlet polynomial (or series),P1 #and similarly for L2, P2, outputs the first M terms of the product P1*P2 DP:=proc(L1,L2,M) local N,L,n,c,sd,d: N:=min(M,nops(L1)*nops(L2)): L:=[]: for n from 1 to N do sd:=divisors(n): c:=0: for d in sd do if d<=nops(L1) and n/d<=nops(L2) then c:=c+L1[d]*L2[n/d]: fi: od: L:=[op(L),c]: od: L: end: #DerD(L,k): the kth derivative of the Dirichlet polynomial given by the list L DerD:=proc(L,k) local n: [seq((-1)^k*log(n)^k*L[n],n=1..nops(L))]: end: #Dpo(L,k,N):the first N terms of the Dirichlet poly L^k Dpo:=proc(L,k,N) local L1: if k=1 then RETURN(L): fi: DP(Dpo(L,k-1,N),L,N): end: #Reci(L,N): the first N terms of the reciprocal of the Dirichlet poly N #Fixed after class Reci:=proc(L,N) local L1,k: if L[1]<>1 then RETURN(FAIL): fi: L1:=-L: L1:=[0,op(2..nops(L1),L1)]: [1,0$(N-1)]+ add(Dpo(L1,k,N),k=1..trunc(N/2)): end: