10.24 MoebiusMu

MoebiusMu( n )

MoebiusMu computes the value of the Moebius function for the integer n. This is 0 for integers which are not squarefree, i.e., which are divisible by a square r^2. Otherwise it is 1 if n has an even number and -1 if n has an odd number of prime factors.

The importance of mu stems from the so called inversion formula. Suppose f(n) is a function defined on the positive integers and let g(n)=sum_{d mid n}{f(d)}. Then f(n)=sum_{d mid n}{mu(d) g(n/d)}. As a special case we have phi(n) = sum_{d mid n}{mu(d) n/d} since n = sum_{d mid n}{phi(d)} (see Phi).

MoebiusMu usually spends all of its time factoring n (see FactorsInt).

    gap> MoebiusMu( 60 );
    0
    gap> MoebiusMu( 61 );
    -1
    gap> MoebiusMu( 62 );
    1 

Previous Up Top
Index

GAP 3.4.4
April 1997