OFFSET
1,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000
FORMULA
a(1) = 1, and for n > 1, a(n) = -Sum_{d|n, d<n} A046897(n/d) * a(d).
From Amiram Eldar, Jan 02 2025: (Start)
Multiplicative with a(2^e) = -3*(-2)^(e-1), and for an odd prime p, a(p) = -(p+1), a(p^2) = p, and a(p^e) = 0 for e >= 3.
Dirichlet g.f.: 1/((1 - 1/4^(s-1)) * zeta(s-1) * zeta(s)). (End)
MATHEMATICA
f[p_, e_] := If[e == 1, -p-1, If[e == 2, p, 0]]; f[2, e_] := -3*(-2)^(e - 1); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Jan 02 2025 *)
PROG
(PARI)
A046897(n) = if(n<1, 0, sumdiv(n, d, if(d%4, d, 0)));
memoA379497 = Map();
A379497(n) = if(1==n, 1, my(v); if(mapisdefined(memoA379497, n, &v), v, v = -sumdiv(n, d, if(d<n, A046897(n/d)*A379497(d), 0)); mapput(memoA379497, n, v); (v)));
(PARI) g(p, e) = if(p == 2, -3*(-2)^(e-1), if(e == 1, -p-1, e == 2, p, e > 2, 0));
a(n) = {my(f = factor(n)); prod(i = 1, #f~, p = f[i, 1]; e = f[i, 2]; g(p, e)); } \\ Amiram Eldar, Jan 02 2025
CROSSREFS
KEYWORD
sign,mult,easy,new
AUTHOR
Antti Karttunen, Jan 02 2025
STATUS
approved