login
A347103
G.f.: Sum_{k>=1} k * x^prime(k) / (1 + x^prime(k)).
1
0, 1, 2, -1, 3, -1, 4, -1, 2, -2, 5, -3, 6, -3, 5, -1, 7, -1, 8, -4, 6, -4, 9, -3, 3, -5, 2, -5, 10, -4, 11, -1, 7, -6, 7, -3, 12, -7, 8, -4, 13, -5, 14, -6, 5, -8, 15, -3, 4, -2, 9, -7, 16, -1, 8, -5, 10, -9, 17, -6, 18, -10, 6, -1, 9, -6, 19, -8, 11, -6, 20, -3
OFFSET
1,3
COMMENTS
a(n) is the sum of indices of prime divisors p|n such that n/p is odd, minus the sum of indices of prime divisors p|n such that n/p is even.
FORMULA
a(n) = -Sum_{p|n, p prime} (-1)^(n/p) * pi(p), where pi = A000720.
MATHEMATICA
nmax = 72; CoefficientList[Series[Sum[k x^Prime[k]/(1 + x^Prime[k]), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
Table[-DivisorSum[n, (-1)^(n/#) PrimePi[#] &, PrimeQ[#] &], {n, 1, 72}]
PROG
(PARI) a(n) = my(f=factor(n)[, 1]); sum(k=1, #f, if ((n/f[k]) % 2, primepi(f[k]), -primepi(f[k]))); \\ Michel Marcus, Aug 19 2021
CROSSREFS
KEYWORD
sign
AUTHOR
Ilya Gutkovskiy, Aug 18 2021
STATUS
approved