OFFSET
1,4
COMMENTS
Also total number of 0's in binary expansion of concatenation of the binary numbers that are the divisors of n written in base 2 (A182621).
a(n) = 0 iff n = 1 or n is a Mersenne prime (A000668). - Bernard Schott, Apr 22 2022
LINKS
Jaroslav Krizek, Table of n, a(n) for n = 1..500
FORMULA
a(2^n) = n*(n+1)/2 = A000217(n). - Bernard Schott, Apr 22 2022
EXAMPLE
a(8) = 6 because the divisors of 8 are [1, 2, 4, 8] and in binary: 1, 10, 100, 1000, so six 0's.
MATHEMATICA
Table[Count[Flatten[IntegerDigits[Divisors[n], 2]], 0], {n, 81}] (* T. D. Noe, Sep 04 2013 *)
PROG
(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
(PARI) a(n) = sumdiv(n, d, 1+logint(d, 2) - hammingweight(d)); \\ Michel Marcus, Apr 24 2022
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Jaroslav Krizek, Aug 31 2013
STATUS
approved