login
A351619
a(n) = Sum_{p|n, p prime} (-1)^p.
2
0, 1, -1, 1, -1, 0, -1, 1, -1, 0, -1, 0, -1, 0, -2, 1, -1, 0, -1, 0, -2, 0, -1, 0, -1, 0, -1, 0, -1, -1, -1, 1, -2, 0, -2, 0, -1, 0, -2, 0, -1, -1, -1, 0, -2, 0, -1, 0, -1, 0, -2, 0, -1, 0, -2, 0, -2, 0, -1, -1, -1, 0, -2, 1, -2, -1, -1, 0, -2, -1, -1, 0, -1, 0, -2, 0, -2, -1, -1, 0, -1, 0, -1, -1, -2, 0, -2, 0, -1, -1, -2, 0, -2, 0, -2, 0, -1, 0, -2, 0, -1
OFFSET
1,15
FORMULA
G.f.: Sum_{k>=1} (-x)^prime(k)/(1 - x^prime(k)).
a(n) = -A001221(n) if n is odd and a(n) = 2 - A001221(n) if n is even. - Chai Wah Wu, Mar 02 2022
PROG
(PARI) a(n) = my(f=factor(n)); sum(k=1, #f~, (-1)^f[k, 1]);
(PARI) my(N=99, x='x+O('x^N)); concat(0, Vec(sum(k=1, N, isprime(k)*(-x)^k/(1-x^k))))
(Python)
from sympy import primefactors
def A351619(n): return (0 if n%2 else 2) - len(primefactors(n)) # Chai Wah Wu, Mar 02 2022
CROSSREFS
KEYWORD
sign
AUTHOR
Seiichi Manyama, Mar 02 2022
STATUS
approved