|
|
A093653
|
|
Total number of 1's in binary expansion of all divisors of n.
|
|
31
|
|
|
1, 2, 3, 3, 3, 6, 4, 4, 5, 6, 4, 9, 4, 8, 9, 5, 3, 10, 4, 9, 9, 8, 5, 12, 6, 8, 9, 12, 5, 18, 6, 6, 8, 6, 9, 15, 4, 8, 10, 12, 4, 18, 5, 12, 15, 10, 6, 15, 7, 12, 9, 12, 5, 18, 11, 16, 10, 10, 6, 27, 6, 12, 17, 7, 8, 16, 4, 9, 10, 18, 5, 20, 4, 8, 16, 12, 11, 20, 6, 15, 12, 8, 5, 27, 9, 10, 12
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
a(2^n) = n+1 (End)
|
|
EXAMPLE
|
a(8) = 4 because the divisors of 8 are [1, 2, 4, 8] and in binary: 1, 10, 100, 1000, so four 1's.
|
|
MAPLE
|
a:= n-> add(add(i, i=Bits[Split](d)), d=numtheory[divisors](n)):
|
|
MATHEMATICA
|
Table[Plus@@DigitCount[Divisors[n], 2, 1], {n, 75}] (* Alonso del Arte, Sep 01 2013 *)
|
|
PROG
|
(PARI) a(n) = {my(v = valuation(n, 2), n = (n>>v)); sumdiv(n, d, hammingweight(d)) * (v + 1)} \\ David A. Corneth, Feb 15 2023
(Python)
from sympy import divisors
def a(n): return sum(bin(d).count("1") for d in divisors(n))
(Python)
from sympy import divisors
def A093653(n): return sum(d.bit_count() for d in divisors(n, generator=True))
|
|
CROSSREFS
|
Cf. A226590 (number of 0's in binary expansion of all divisors of n).
Cf. A182627 (number of digits in binary expansion of all divisors of n).
Cf. A034690 (a decimal equivalent).
|
|
KEYWORD
|
base,easy,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|