 NumberTheory - Maple Programming Help

Home : Support : Online Help : Mathematics : Number Theory : NumberTheory/Moebius

NumberTheory

 Moebius
 Moebius function

Calling Sequence

 Moebius(n) Möbius(n) mu(n) $\mathrm{\mu }\left(n\right)$

Parameters

 n - positive integer

Description

 • The Moebius(n) command computes the Moebius function of the positive integer n.
 • If n is divisible by the square of a prime number, then Moebius(n) is equal to 0. Otherwise, Moebius(n) is equal to 1 if n has an even number of prime factors, and is equal to -1 if n has an odd number of prime factors.
 • $\mathrm{Möbius}$ and mu are aliases of Moebius.
 • You can enter the command mu using either the 1-D or 2-D calling sequence. For example, mu(8) is equivalent to $\mathrm{\mu }\left(8\right)$.

Examples

 > with(NumberTheory):
 > Moebius(1);
 ${1}$ (1)
 > Moebius(3^3 * 5);
 ${0}$ (2)
 > Moebius(3*5*7);
 ${-1}$ (3)
 > Moebius(23*11);
 ${1}$ (4)

The Möbius function is multiplicative as an arithmetic function. That is, if n and m are coprime then Moebius(n*m) = Moebius(n)*Moebius(m).

 > igcd(5657, 31945103);
 ${1}$ (5)
 > mu(5657 * 31945103);
 ${-1}$ (6)
 > mu(5657) * mu(31945103);
 ${-1}$ (7)

The first 50 values for the Moebius function are plotted below:

 > plots:-pointplot([seq([n, Moebius(n)], n = 1 .. 50)], labels = ["n", μ(n)], symbol = soliddiamond, symbolsize = 15, color = "OrangeRed", size = [600, 400], tickmarks = [default, [-1, 0, 1]]); Compatibility

 • The NumberTheory[Moebius] command was introduced in Maple 2016.