login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A368647
The number of distinct primes of the form 3*k+2 dividing n minus the number of distinct primes of the form 3*k+1 dividing n.
1
0, 1, 0, 1, 1, 1, -1, 1, 0, 2, 1, 1, -1, 0, 1, 1, 1, 1, -1, 2, -1, 2, 1, 1, 1, 0, 0, 0, 1, 2, -1, 1, 1, 2, 0, 1, -1, 0, -1, 2, 1, 0, -1, 2, 1, 2, 1, 1, -1, 2, 1, 0, 1, 1, 2, 0, -1, 2, 1, 2, -1, 0, -1, 1, 0, 2, -1, 2, 1, 1, 1, 1, -1, 0, 1, 0, 0, 0, -1, 2, 0, 2
OFFSET
1,10
LINKS
FORMULA
Additive with a(p^e) = 0 if p = 3, 1 if p == 2 (mod 3), and -1 if p == 1 (mod 3).
a(n) = A005090(n) - A005088(n).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = A086241 = 0.641944... .
MATHEMATICA
f[p_, e_] := Switch[Mod[p, 3], 0, 0, 1, -1, 2, 1]; a[1] = 0; a[n_] := Plus @@ f @@@ FactorInteger[n]; Array[a, 100]
PROG
(PARI) a(n) = {my(p = factor(n)[, 1]); sum(i = 1, #p, if(p[i]%3 == 0, 0, if(p[i]%3 == 1, -1, 1))); }
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Amiram Eldar, Jan 02 2024
STATUS
approved