Help:=proc(): print(` DiriF(f,s,N), Diri(f,s,N), Conv(f,g,n), MyDiv(n) `): end: with(numtheory): MyDiv:=proc(n) local S,i: S:={}: for i from 1 to n do if type(n/i,integer) then S:=S union {i}: fi: od: S: end: #DiriF(f,s,N): inputs a discrete function f, and a symbol s and a positive integer N, outputs the first N terms of the Dirichlet series of f(n). Try #DiriF(n->1,s,10); DiriF:=proc(f,s,N) local n: add(f(n)/n^s,n=1..N): end: #Diri(f,s,N): inputs a discrete function f, and a symbol s and a positive integer N, outputs the truncated value at N in floating-point #Diri(n->1,s,10); Diri:=proc(f,s,N) local n: add(evalf(evalc(f(n)/n^s)),n=1..N): end: #Conv(f,g,n): the convolution of f(n) and g(n) Conv:=proc(f,g,n) local S,s: S:=divisors(n): add(f(s)*g(n/s),s in S): end: