A350387 a(n) is the sum of the odd exponents in the prime factorization of n.
0, 1, 1, 0, 1, 2, 1, 3, 0, 2, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 2, 2, 1, 4, 0, 2, 3, 1, 1, 3, 1, 5, 2, 2, 2, 0, 1, 2, 2, 4, 1, 3, 1, 1, 1, 2, 1, 1, 0, 1, 2, 1, 1, 4, 2, 4, 2, 2, 1, 2, 1, 2, 1, 0, 2, 3, 1, 1, 2, 3, 1, 3, 1, 2, 1, 1, 2, 3, 1, 1, 0, 2, 1, 2, 2, 2, 2, 4, 1, 2, 2, 1, 2, 2, 2, 6, 1, 1, 1, 0, 1, 3, 1, 4, 3
Offset: 1
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
f[p_, e_] := If[OddQ[e], e, 0]; a[1] = 0; a[n_] := Plus @@ f @@@ FactorInteger[n]; Array[a, 100]
-
PARI
a(n) = my(f=factor(n)); sum(k=1, #f~, if (f[k,2] %2, f[k,2])); \\ Michel Marcus, Dec 28 2021
-
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
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}).
Comments