A226590 Total number of 0's in binary expansion of all divisors of n.
0, 1, 0, 3, 1, 2, 0, 6, 2, 4, 1, 6, 1, 2, 1, 10, 3, 7, 2, 9, 2, 4, 1, 12, 3, 4, 3, 6, 1, 6, 0, 15, 5, 8, 4, 15, 3, 6, 3, 16, 3, 8, 2, 9, 5, 4, 1, 20, 3, 9, 5, 9, 2, 10, 3, 12, 4, 4, 1, 15, 1, 2, 4, 21, 7, 14, 4, 15, 5, 12, 3, 26, 4, 8, 6, 12, 4, 10, 2, 25, 7
Offset: 1
Examples
a(8) = 6 because the divisors of 8 are [1, 2, 4, 8] and in binary: 1, 10, 100, 1000, so six 0's.
Links
- Jaroslav Krizek, Table of n, a(n) for n = 1..500
Crossrefs
Programs
-
Mathematica
Table[Count[Flatten[IntegerDigits[Divisors[n], 2]], 0], {n, 81}] (* T. D. Noe, Sep 04 2013 *)
-
PARI
a(n) = sumdiv(n, d, 1+logint(d, 2) - hammingweight(d)); \\ Michel Marcus, Apr 24 2022
-
Python
from sympy import divisors def a(n): return sum(bin(d)[2:].count("0") for d in divisors(n)) print([a(n) for n in range(1, 88)]) # Michael S. Branicky, Apr 20 2022
Formula
a(2^n) = n*(n+1)/2 = A000217(n). - Bernard Schott, Apr 22 2022
Comments