OFFSET
1,5
COMMENTS
Discovered when incorrectly applying Mobius inversion formula.
a(n)*a(m) = a(n*m) if gcd(n,m)=1 (has a simple proof).
Strongly multiplicative: a(p^e) = 2 - p. - Charles R Greathouse IV, Oct 01 2019
LINKS
Indranil Ghosh, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = Sum_{d|n} mu(d)*phi(d).
G.f.: Sum_{k>=1} mu(k)*phi(k)*x^k/(1 - x^k). - Ilya Gutkovskiy, Nov 06 2018
a(n) = Product_{p prime and p|n} (2-p). - Robert FERREOL, Mar 14 2020
Dirichlet g.f.: zeta(s) * Product_{primes p} (1 - p^(1-s) + p^(-s)). - Vaclav Kotesovec, Jun 14 2020
a(n) = Sum_{k = 1..n} mu(lcm(k, n)/k). - Peter Bala, Jan 16 2024
EXAMPLE
mu(d)*phi(d) = 1*1,-1*1,-1*2, 1*2 for d=1,2,3,6, so a(6) = 1*1-1*1-1*2+1*2 = 0.
MAPLE
with(numtheory):seq(convert(map(x->2-x, factorset(n)), `*`), n=1..99); # Robert FERREOL, Mar 14 2020
MATHEMATICA
Table[Sum[MoebiusMu[d] EulerPhi[d], {d, Divisors[n]}], {n, 99}] (* Indranil Ghosh, Mar 10 2017 *)
a[1] = 1; a[n_] := Times @@ ((2 - First[#])& /@ FactorInteger[n]); Array[a, 100] (* Amiram Eldar, Sep 21 2020 *)
PROG
(PARI) r=0; fordiv(n, d, r+=moebius(d)*eulerphi(d)); r
(PARI) a(n) = sumdiv(n, d, moebius(d)*eulerphi(d)); \\ Michel Marcus, Sep 30 2016
(PARI) a(n)=my(f=factor(n)[, 1]); prod(i=1, #f, 2-f[i]) \\ Charles R Greathouse IV, Oct 01 2019
(PARI) for(n=1, 100, print1(direuler(p=2, n, (1 - p*X + X)/(1 - X))[n], ", ")) \\ Vaclav Kotesovec, Jun 14 2020
CROSSREFS
KEYWORD
mult,sign,easy
AUTHOR
Jurjen N.E. Bos, Sep 20 2016
STATUS
approved