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.
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
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
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]
-
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)));}