A367169 a(n) is the sum of the exponents in the prime factorization of n that are powers of 2.
0, 1, 1, 2, 1, 2, 1, 0, 2, 2, 1, 3, 1, 2, 2, 4, 1, 3, 1, 3, 2, 2, 1, 1, 2, 2, 0, 3, 1, 3, 1, 0, 2, 2, 2, 4, 1, 2, 2, 1, 1, 3, 1, 3, 3, 2, 1, 5, 2, 3, 2, 3, 1, 1, 2, 1, 2, 2, 1, 4, 1, 2, 3, 0, 2, 3, 1, 3, 2, 3, 1, 2, 1, 2, 3, 3, 2, 3, 1, 5, 4, 2, 1, 4, 2, 2, 2
Offset: 1
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Mathematica
f[p_, e_] := If[e == 2^IntegerExponent[e, 2], e, 0]; a[1] = 0; a[n_] := Plus @@ f @@@ FactorInteger[n]; Array[a, 100]
-
PARI
a(n) = {my(f = factor(n)); sum(i = 1, #f~, if(f[i, 2] == 1 << valuation(f[i, 2], 2), f[i, 2], 0));}
-
Python
from sympy import factorint def A367169(n): return sum(e for e in factorint(n).values() if not(e&-e)^e) # Chai Wah Wu, Nov 10 2023