MÖBIUS's FUNCTION

August Ferdinand Möbius

\[\mu (n)\]

$$\mu ~~~~ mu $$

\[\mu(n) = \left\{\begin{matrix} (-1)^k\ for\ n\ product\ of\ k\ distinct\ primes \\ 0\ otherwise\ if\ n\ is\ divisible\ by\ a\ square\ \end{matrix}\right.\]

A008683 Moebius (or Mobius) function.

1,-1,-1,0,-1,1,-1,0,0,1,-1,0,-1,1,1,0,-1,0,-1,0,1,1,-1,0,0,1
A008683    OEIS

#A008683 		Moebius (or Mobius) function
#a(n) = sum(exp(2*pi*I*k/n), k=1..n and gcd(k,n)=1), the sum over the primitive n-th roots of unity. See the Apostol reference, p. 48, Exercise 14 (b). - Wolfdieter Lang, Jun 13 2011

#Choose a value for n, example with 13.
n=13 
sum([ exp(  2*pi*I*k/n  ) for k in range(n+1) if gcd(n,k) == 1]).numerical_approx();
#".numerical_approx()" can be deleted to see the whole expression



print [moebius(n) for n in (1..10)]

#A008683 		Moebius (or Mobius) function
#Choose a value for n, example with 13.
n=13 
sum([ exp(  2*pi*I*k/n  ) for k in range(n+1) if gcd(n,k) == 1]).numerical_approx();
#".numerical_approx()" can be deleted to see the whole expression

A030229 Moebius (or Mobius) function mu(n).

1,6,10,14,15,21,22,26,33,34,35,38,39,46,51,55,57,58,62,65,69,74
A030229    OEIS

A030059 Product of an odd number of distinct primes.

2,3,5,7,11,13,17,19,23,29,30,31,37,41,42,43,47,53,59,61,66,67,70
A030059    OEIS

A013929 Numbers that are not squarefree.

4,8,9,12,16,18,20,24,25,27,28,32,36,40,44,45,48,49,50,52,54,56,60
A013929    OEIS

\[\mu (n)= \begin{cases} & (-1)^{\omega (n)}=(-1)^{\Omega (n)}~~if~~\omega (n)=\Omega (n) \\ & 0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~if~~\omega (n)\neq \Omega (n) \end{cases}\]

A076479 mu(rad(n))

1,-1,-1,-1,-1,1,-1,-1,-1,1,-1,1,-1,1,1,-1,-1,1,-1,1,1,1,-1,1,-1
A076479    OEIS

A008836 Liouville's function

1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,-1,1,1,1,-1,-1,-1,-1,1,1,-1,1,1
A008836    OEIS

table([(n,moebius(n) ) for n in [1..50]], header_row=['n', 'MoebiusFunction(n)'])
MoebiusFunction = [moebius(n) for n in range(1, 50)]
graphique = list_plot(MoebiusFunction, color='red', pointsize=10, title='Moebius function', aspect_ratio='automatic')
graphique.axes_labels(['$x$', '$y$'])
graphique.axes_labels_size(1)
graphique.set_axes_range(0, 50, -1, 1)
graphique.axes_width(0.5)
graphique
MÖBIUS's INVERSION

\[if~~\forall n\in \mathbb{N}^{*}~~g(n)=\sum_{d|n} f(d)\\so~~\forall n\in \mathbb{N}^{*}~~f(n)=\sum_{d|n} g(d)\mu (\frac{n}{d})=\sum_{d|n} \mu (d) g(\frac{n}{d})\]

The Möbius inversion applied to the Euler's Phi function :
\[\forall n\in \mathbb{N}^{*}~~g(n)=\sum_{d|n} f(d)\\ \forall n\in \mathbb{N}^{*}~~n=\sum_{d|n} \varphi (d)~\Rightarrow~g(n)=\sum_{d|n} \varphi (d) \\ so~~\forall n\in \mathbb{N}^{*}~~\varphi (d)=\sum_{d|n} d~\mu (\frac{n}{d})=\sum_{d|n} \mu (d) \frac{n}{d}\] \[\frac{\varphi (n)}{n}=\sum_{d|n} (\frac{\mu(d)}{d})\]


  euler_phi(d) == sum([d*moebius(n/d) for d in divisors(n)]) == sum([moebius(d)*n/d for d in divisors(n)])
  euler_phi(n)/n == sum([moebius(d)/d for d in divisors(n)])

The Möbius inversion applied to the Tau function :
\[\forall n\in \mathbb{N}^{*}~~g(n)=\sum_{d|n} f(d)\\ \forall n\in \mathbb{N}^{*}~~\tau (n)=\sum_{d|n}1~\Rightarrow~ g(n)=\sum_{d|n} 1 \\so~~\forall n\in \mathbb{N}^{*}~~1=\sum_{d|n} \tau (d)~\mu (\frac{n}{d})=\sum_{d|n} \mu (d) \tau (\frac{n}{d})\]


1 == sum([ sigma(d,0)*moebius(n/d) for d in divisors(n)]) == sum([ moebius(d)*sigma(n/d,0) for d in divisors(n)])

LEVI-CIVITA SYMBOL

The Möbius function can be seen as a Levi-Civita symbol of different dimensions by multiplying the Kronecker delta of A001221 and A001222 (which is A008966) by A008836
\[\mu (n)=\delta _{\omega (n)\Omega (n)}\lambda (n)\]


  #The Möbius function can be seen as a Levi-Civita symbol of different dimensions by multiplying the Kronecker delta of A001221 and A001222 (which is A008966) by A008836.

  # Number of distinct primes dividing n         omega(n)
  A001221 = [0, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 3, 1, 2, 2, 1, 2, 3, 1, 2, 2, 3, 1, 2, 1, 2, 2, 2, 2, 3, 1, 2, 1, 2, 1, 3, 2, 2, 2, 2, 1, 3, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 3, 1, 2, 3, 2, 1, 2, 1, 3, 2]
  
  # Number of prime divisors of n counted with multiplicity             bigomega(n)
  A001222 = [0, 1, 1, 2, 1, 2, 1, 3, 2, 2, 1, 3, 1, 2, 2, 4, 1, 3, 1, 3, 2, 2, 1, 4, 2, 2, 3, 3, 1, 3, 1, 5, 2, 2, 2, 4, 1, 2, 2, 4, 1, 3, 1, 3, 3, 2, 1, 5, 2, 3, 2, 3, 1, 4, 2, 4, 2, 2, 1, 4, 1, 2, 3, 6, 2, 3, 1, 3, 2, 3, 1, 5, 1, 2, 3, 3, 2, 3, 1, 5, 4, 2, 1, 4, 2, 2, 2, 4, 1, 4, 2, 3, 2, 2, 2, 6, 1, 3, 3, 4, 1, 3, 1, 4, 3, 2, 1, 5, 1, 3, 2]
  
  # Liouville's function
  A008836 = [1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, -1, 1, -1, 1, 1, -1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, -1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, -1, -1, -1, 1, -1]
  
  # Möbius's function
  A008683 = [1, -1, -1, 0, -1, 1, -1, 0, 0, 1, -1, 0, -1, 1, 1, 0, -1, 0, -1, 0, 1, 1, -1, 0, 0, 1, 0, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, 1, 1, 0, -1, -1, -1, 0, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, 1, 0, 1, 1, -1, 0, -1, 1, 0, 0, 1, -1, -1, 0, 1, -1, -1, 0, -1, 1, 0, 0, 1, -1]
  
  
  # = A008966   1 if n is squarefree, else 0.      abs(mu(n))
  [kronecker_delta(A001221[n],A001222[n]) for n in range(0, 20)]
  
  # = A008683 Möbius's function
  [kronecker_delta(A001221[n],A001222[n])*A008836[n] for n in range(0, 20)]
  
  #
  N=1000
  n=A001221[2]
  m=A001222[2]
  kronecker_delta(A001221[2],A001222[2])
  
  1/N*sum([exp(2*pi*I*(n-m)*k/N) for k in range(1,N)]).numerical_approx()
  
  kro=1/N*sum([exp(2*pi*I*(n-m)*k/N) for k in range(1,N)]).numerical_approx()
  kro*A008836[2].numerical_approx()