OFFSET
1,10
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
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