OFFSET
1,10
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = Sum_{p|n, p prime} (pi(p) mod 2) * floor(1/gcd(p,n/p)).
From Amiram Eldar, Oct 06 2023: (Start)
Additive with a(p^e) = 1 if e = 1 and primepi(p) is odd and 0 otherwise. (End)
MATHEMATICA
f[p_, e_] := If[e == 1 && OddQ[PrimePi[p]], 1, 0]; a[1] = 0; a[n_] := Plus @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Oct 06 2023 *)
PROG
(PARI) a(n) = {my(f = factor(n)); sum(i = 1, #f~, if(f[i, 2] == 1 && primepi(f[i, 1])%2, 1, 0)); } \\ Amiram Eldar, Oct 06 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Jun 16 2021
STATUS
approved