Sum of Moebius function of n over its divisors
This text shows the calculation of sum of möbius function of n over the divisors of n.
Maxima 5.20.0 http://maxima.sourceforge.net
using Lisp CMU Common Lisp 19f (19F)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) block(load(("/Users/yasube/Programming/imaxima-imath/imaxima.lisp")), linenum:0)$
(%i1) dsum(exp, var, N) ::=
if integerp(N)
then buildq([exp:exp,var:var,N:N],block([res:0,divlist:listify(divisors(N))], for var in divlist do res:res+exp, return(res)))
else apply(nounify(dsum),[exp,var,N])$
(%i2) texput(nounify(dsum),
lambda([arglist], block([e,v,pm],[e,v,pm]:args(arglist),
concat("\\sum_{",tex1(v) ,"|",tex1(pm),"}",tex1(e)))))$
(%i3) texput(moebius, "\\mu");
using Lisp CMU Common Lisp 19f (19F)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) block(load(("/Users/yasube/Programming/imaxima-imath/imaxima.lisp")), linenum:0)$
(%i1) dsum(exp, var, N) ::=
if integerp(N)
then buildq([exp:exp,var:var,N:N],block([res:0,divlist:listify(divisors(N))], for var in divlist do res:res+exp, return(res)))
else apply(nounify(dsum),[exp,var,N])$
(%i2) texput(nounify(dsum),
lambda([arglist], block([e,v,pm],[e,v,pm]:args(arglist),
concat("\\sum_{",tex1(v) ,"|",tex1(pm),"}",tex1(e)))))$
(%i3) texput(moebius, "\\mu");
We already learned the following equation, representing the Dirichlet series generating function for möbius function.
(%i4) moe0:sum(moebius(n)/n^s,n,1,inf)=1/zeta(s);
(%i5) moe1:moe0*zeta(s);
(%i6) subst(sum(1/n^s,n,1,inf),zeta(s),moe1);
(%i5) moe1:moe0*zeta(s);
(%i6) subst(sum(1/n^s,n,1,inf),zeta(s),moe1);
We also learned that the multiplication of two Dirichlet series results also a Dirichlet series of convolution product.
(%i7) moe2:sum(a(n)/n^s,n,1,inf)*sum(b(n)/n^s,n,1,inf)=sum(dsum(a(d)*b(n/d),d,n)/n^s,n,1,inf);
Using this, we can calculate the left hand side of (%o6).
(%i8) moe3:moe2,a(n):=moebius(n),b(n):=1;
(%i9) rhs(moe3)=1;
(%i9) rhs(moe3)=1;
Hence, if n=1,
(%i10) dsum(moebius(d),d,n)=1;
if n>1 then,
if n>1 then,
(%i11) dsum(moebius(d),d,n)=0;
(%i12)
(%i12)