OFFSET
0,3
COMMENTS
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Peter Luschny, Sequences related to Euler's totient function.
FORMULA
From Amiram Eldar, Nov 30 2022: (Start)
Multiplicative with a(p)= p + 1, and a(p^e) = p^e + p^(e-1) - p^(e-2) if e > 1.
Sum_{k=1..n} a(k) ~ c * n^2, where c = (1/2) * Product_{p prime} (1 + 1/p^2 - 1/p^4) = 0.7124102278... . (End)
MATHEMATICA
mu2[1] = 1; mu2[n_] := Sum[Boole[Divisible[n, d^2]]*MoebiusMu[n/d^2]*MoebiusMu[n/d], {d, Divisors[n]}]; a[n_] := Sum[k*mu2[n/k], {k, Divisors[n]}]; Table[a[n], {n, 0, 59}] (* Jean-François Alcover, Feb 05 2014 *)
f[p_, e_] := p^e + p^(e - 1) - If[e > 1, p^(e - 2), 0]; a[0] = 0; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100, 0] (* Amiram Eldar, Nov 30 2022 *)
PROG
(PARI) a(n) = if(n == 0, 0, my(f = factor(n)); prod(i = 1, #f~, f[i, 1]^f[i, 2] + f[i, 1]^(f[i, 2]-1) - if(f[i, 2] > 1, f[i, 1]^(f[i, 2]-2), 0))); \\ Amiram Eldar, Nov 30 2022
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
Peter Luschny, Oct 30 2010
STATUS
approved