#C2.txt, Jan. 22, 2018 Help:=proc(): print(` Conv(L1,L2),Mo(n), M(n) , T(L), IT(L), phi1(n) `): end: with(numtheory): #Conv(L1,L2), inputs two LISTS L1, L2, and outputs the list that is the convolution #of length min(nops(L1),nops(L2)) Conv:=proc(L1,L2) local d,n: [seq( add(L1[d]*L2[n/d], d in divisors(n)), n=1..min(nops(L1),nops(L2)))]: end: #Mo(n): The Mobius function from scratch, using (1.9) in Professor H. Iwaniec's masterpiece Mo:=proc(n) local S,d: option remember: if n=1 then RETURN(1): else S:=divisors(n) minus {n}: RETURN(-add(Mo(d),d in S)): fi: end: #M(n): the partial sum of Mo(n), the Mertens function M:=proc(n) local i: add(Mo(i),i=1..n): end: #T(L): (1.11) inputs a sequence L and outputs a sequence of the same length #where the n-th entry is the sum of L[d] over divisors of n T:=proc(L) local n,d: [seq( add(L[d], d in divisors(n)) , n=1..nops(L))]: end: #IT(L): The inverse of T(L) IT:=proc(L) local n,d: [seq( add( Mo(d)* L[n/d], d in divisors(n)) , n=1..nops(L))]: end: #phi1(n): phi(n), using the definition that phi(n) is the number of integers <=n coprime with n phi1:=proc(n) local i,su: su:=0: for i from 1 to n do if gcd(i,n)=1 then su:=su+1: fi: od: su: end: