login
A349341
Dirichlet inverse of A026741, which is defined as n if n is odd, n/2 if n is even.
4
1, -1, -3, -1, -5, 3, -7, -1, 0, 5, -11, 3, -13, 7, 15, -1, -17, 0, -19, 5, 21, 11, -23, 3, 0, 13, 0, 7, -29, -15, -31, -1, 33, 17, 35, 0, -37, 19, 39, 5, -41, -21, -43, 11, 0, 23, -47, 3, 0, 0, 51, 13, -53, 0, 55, 7, 57, 29, -59, -15, -61, 31, 0, -1, 65, -33, -67, 17, 69, -35, -71, 0, -73, 37, 0, 19, 77, -39, -79
OFFSET
1,3
LINKS
FORMULA
a(1) = 1; a(n) = -Sum_{d|n, d < n} A026741(n/d) * a(d).
a(n) = A349342(n) - A026741(n).
a(2n+1) = A349343(2n+1) for all n >= 1.
Multiplicative with a(2^e) = -1, a(p) = -p and a(p^e) = 0 if e > 1. - Sebastian Karlsson, Nov 15 2021
MATHEMATICA
a[1]=1; a[n_]:=-DivisorSum[n, If[OddQ[n/#], n/#, n/(2#)]*a@#&, #<n&]; Array[a, 79] (* Giorgos Kalogeropoulos, Nov 15 2021 *)
f[p_, e_] := If[e == 1, -p, 0]; f[2, e_] := -1; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 18 2023 *)
PROG
(PARI) A349341(n) = { my(f = factor(n)); prod(i=1, #f~, if(2==f[i, 1], -1, if(1==f[i, 2], -f[i, 1], 0))); };
(Python)
from sympy import prevprime, factorint, prod
def f(p, e):
return -1 if p == 2 else 0 if e > 1 else -p
def a(n):
return prod(f(p, e) for p, e in factorint(n).items()) # Sebastian Karlsson, Nov 15 2021
CROSSREFS
Agrees with A349343 on odd numbers.
Sequence in context: A307806 A127418 A099550 * A099549 A334212 A082725
KEYWORD
sign,easy,mult
AUTHOR
Antti Karttunen, Nov 15 2021
STATUS
approved