|
|
A189021
|
|
Apostol's second order Möbius (or Moebius) function mu_2(n).
|
|
8
|
|
|
1, 1, 1, -1, 1, 1, 1, 0, -1, 1, 1, -1, 1, 1, 1, 0, 1, -1, 1, -1, 1, 1, 1, 0, -1, 1, 0, -1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, -1, -1, 1, 1, 0, -1, -1, 1, -1, 1, 0, 1, 0, 1, 1, 1, -1, 1, 1, -1, 0, 1, 1, 1, -1, 1, 1, 1, 0, 1, 1, -1, -1, 1, 1, 1, 0, 0, 1, 1, -1, 1, 1, 1, 0, 1, -1, 1, -1, 1, 1, 1, 0, 1, -1, -1, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1
|
|
COMMENTS
|
The function mu_k(n) is defined to be 0 if a (k+1)st power of a prime divides n, otherwise it is (-1)^r where r is the number of distinct primes p that appear as p^k in the canonical factorization of n.
Differs from the (non-multiplicative) A053864 at n= 12, 18, 20, 28, 44, 45, 50, 52, 60, ... R. J. Mathar, Dec 17 2012
|
|
LINKS
|
|
|
FORMULA
|
mu_k(n) = sum_{d^k|n} mu_{k-1}(n/d^k)*mu_{k-1}(n/d), k>=2.
Multiplicative with a(p)=1, a(p^2)=-1 and a(p^e)=0 if e>=3. Dirichlet g.f. product_{primes p} (1+p^(-s)-p^(-2s)). - R. J. Mathar, Oct 31 2011
|
|
MAPLE
|
A189021 := proc(n) local d, d1, d2; d1:=divisors(n); d2:=select(m->member(m^2, d1), d1); add(mobius(n/d^2)*mobius(n/d), d=d2) end; # Peter Luschny, Oct 30 2010
mu := proc(n, k) local d, a; if k = 1 then return numtheory[mobius](n) ; end if; a := 0 ; for d in numtheory[divisors](n) do if n mod (d^k) = 0 then a := a+procname(n/d^k, k-1)*procname(n/d, k-1) ; end if; end do: a ; end proc:
A189021 := proc(n) mu(n, 2) ; end proc:
|
|
MATHEMATICA
|
a[1] = 1; a[n_] := Sum[ Boole[ Divisible[n, d^2]]*MoebiusMu[n/d^2]*MoebiusMu[n/d], {d, Divisors[n]}]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jun 24 2013 *)
f[p_, e_] := Which[e == 1, 1, e==2, -1, e > 2, 0]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 21 2020 *)
|
|
PROG
|
(PARI) a(n)=if(n<2, 1, sumdiv(n, d, if(n%d^2, 0, moebius(n/d^2)*moebius(n/d)))) \\ Benoit Cloitre, Oct 03 2010
(Python)
from sympy import factorint, prod
def a(n): return 1 if n==1 else prod(1 if e==1 else -1 if e==2 else 0 for p, e in factorint(n).items())
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign,mult,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|