A093653 Total number of 1's in binary expansion of all divisors of n.
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
Offset: 1
Examples
a(8) = 4 because the divisors of 8 are [1, 2, 4, 8] and in binary: 1, 10, 100, 1000, so four 1's.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..16384 (first 500 terms from Jaroslav Krizek)
- Maxwell Schneider and Robert Schneider, Digit sums and generating functions, arXiv:1807.06710 [math.NT], 2018. See (22) p. 6.
- Index entries for sequences related to binary expansion of n
Crossrefs
Programs
-
Maple
a:= n-> add(add(i, i=Bits[Split](d)), d=numtheory[divisors](n)): seq(a(n), n=1..100); # Alois P. Heinz, May 17 2022
-
Mathematica
Table[Plus@@DigitCount[Divisors[n], 2, 1], {n, 75}] (* Alonso del Arte, Sep 01 2013 *)
-
PARI
A093653(n) = sumdiv(n,d,hammingweight(d)); \\ Antti Karttunen, Dec 14 2017
-
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)) print([a(n) for n in range(1, 88)]) # Michael S. Branicky, Apr 20 2022
-
Python
from sympy import divisors def A093653(n): return sum(d.bit_count() for d in divisors(n, generator=True)) print([A093653(n) for n in range(1, 88)]) # Michael S. Branicky, Feb 15 2023
Formula
a(n) = Sum_{k = 0..n} if(mod(n, k) = 0, A000120(k), 0). - Paul Barry, Jan 14 2005
From Bernard Schott, May 16 2022: (Start)
a(2^n) = n+1 (End)