OFFSET
1,6
COMMENTS
First differs from A125073 at n = 32.
a(n) is the number of prime divisors of n, counted with multiplicity, with an odd exponent in the prime factorization of n.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
Additive with a(p^e) = e if e is odd and 0 otherwise.
a(n) = 0 if and only if n is a positive square (A000290 \ {0}).
MATHEMATICA
f[p_, e_] := If[OddQ[e], e, 0]; a[1] = 0; a[n_] := Plus @@ f @@@ FactorInteger[n]; Array[a, 100]
PROG
(Python)
from sympy import factorint
def a(n): return sum(e for e in factorint(n).values() if e%2 == 1)
print([a(n) for n in range(1, 106)]) # Michael S. Branicky, Dec 28 2021
(PARI) a(n) = my(f=factor(n)); sum(k=1, #f~, if (f[k, 2] %2, f[k, 2])); \\ Michel Marcus, Dec 28 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Amiram Eldar, Dec 28 2021
STATUS
approved