OFFSET
1,3
LINKS
Harry J. Smith, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = Sum_{d|n} pi(n/d)*mu(d).
EXAMPLE
n=12, divisors = D(12) = {1,2,3,4,6,12}, pi(12/divisors) = {5,3,2,2,1,0}, mu(divisors) = {1,-1,-1,0,1,0}, Sum = 5*1 - 3*1 - 2*1 + 0 + 1*1 + 0 = 1, thus a(12)=1; for p=prime(n), pi(p/divisor) = {n,0}, mu({1,p})={1,-1}, Sum = 1*n + 0 = n, so a(prime(n)) = n.
MATHEMATICA
f[n_] := Block[{d = Divisors@n}, Plus @@ (MoebiusMu /@ (n/d)*PrimePi /@ d)]; Array[f, 94] (* Robert G. Wilson v, Dec 07 2005 *)
PROG
(PARI) { for (n=1, 1000, d=divisors(n); write("b062778.txt", n, " ", sum(k=1, length(d), primepi(n/d[k]) * moebius(d[k]))) ) } \\ Harry J. Smith, Aug 10 2009
(PARI) a(n) = sumdiv(n, d, primepi(d)*moebius(n/d)); \\ Michel Marcus, Nov 05 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Jul 18 2001
STATUS
approved