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

 > $\mathrm{with}\left(\mathrm{NumberTheory}\right):$
 > $\mathrm{Moebius}\left(1\right)$
 ${1}$ (1)
 > $\mathrm{Moebius}\left({3}^{3}\cdot 5\right)$
 ${0}$ (2)
 > $\mathrm{Moebius}\left(3\cdot 5\cdot 7\right)$
 ${-1}$ (3)
 > $\mathrm{Moebius}\left(23\cdot 11\right)$
 ${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).

 > $\mathrm{igcd}\left(5657,31945103\right)$
 ${1}$ (5)
 > $\mathrm{\mu }\left(5657\cdot 31945103\right)$
 ${-1}$ (6)
 > $\mathrm{\mu }\left(5657\right)\mathrm{\mu }\left(31945103\right)$
 ${-1}$ (7)

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

 > $\mathrm{plots}:-\mathrm{pointplot}\left(\left[\mathrm{seq}\left(\left[n,\mathrm{Moebius}\left(n\right)\right],n=1..50\right)\right],\mathrm{labels}=\left["n",\mu \left(n\right)\right],\mathrm{symbol}=\mathrm{soliddiamond},\mathrm{symbolsize}=15,\mathrm{color}="OrangeRed",\mathrm{size}=\left[600,400\right],\mathrm{tickmarks}=\left[\mathrm{default},\left[-1,0,1\right]\right]\right)$ Compatibility

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