OFFSET
1,3
COMMENTS
Inverse Möbius transform of n * c(n) * ((pi(n)+1) mod 2), where c(n) is the prime characteristic (A010051). - Wesley Ivan Hurt, Jun 23 2024
LINKS
Martin Ehrenstein, Table of n, a(n) for n = 1..20000
FORMULA
a(n) = Sum_{p|n} p * ((pi(p)+1) mod 2).
G.f.: Sum_{k>=1} prime(2*k) * x^prime(2*k) / (1 - x^prime(2*k)). - Ilya Gutkovskiy, Oct 24 2023
a(n) = Sum_{d|n} d * c(d) * ((pi(d)+1) mod 2), where c = A010051. - Wesley Ivan Hurt, Jun 23 2024
EXAMPLE
a(12) = Sum_{p|12} p * ((pi(p)+1) mod 2) = 2*0 + 3*1 = 3.
MATHEMATICA
Table[Sum[k*Mod[PrimePi[k] + 1, 2] (PrimePi[k] - PrimePi[k - 1]) (1 - Ceiling[n/k] + Floor[n/k]), {k, n}], {n, 100}]
PROG
(PARI) a(n) = my(f=factor(n)); sum(k=1, #f~, if (!(primepi(f[k, 1]) % 2), f[k, 1])); \\ Michel Marcus, Jun 12 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Jun 02 2021
STATUS
approved