OFFSET
1,3
FORMULA
Sum_{k=1..n} a(k) ~ n * log(2)^2.
Multiplicative with a(2^e) = (e^2-5*e+2)/2, and a(p^e) = (e+1)*(e+2)/2 for an odd prime p. - Amiram Eldar, Jan 13 2024
MATHEMATICA
Table[Sum[Sum[-(-1)^d, {d, Divisors[k]}]*(-1)^(n/k+1), {k, Divisors[n]}], {n, 1, 100}]
f[p_, e_] := (e + 1)*(e + 2)/2; f[2, e_] := (e^2 - 5*e + 2)/2; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Jan 13 2024 *)
PROG
(PARI) a(n) = {my(f = factor(n), p, e); prod(i = 1, #f~, p = f[i, 1]; e=f[i, 2]; if(p == 2, (e^2-5*e+2)/2, (e+1)*(e+2)/2)); } \\ Amiram Eldar, Jan 13 2024
CROSSREFS
KEYWORD
sign,mult
AUTHOR
Vaclav Kotesovec, Jan 13 2024
STATUS
approved