login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A093653 Total number of 1's in binary expansion of all divisors of n. 31

%I #56 Feb 15 2023 18:54:22

%S 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,

%T 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,

%U 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

%N Total number of 1's in binary expansion of all divisors of n.

%H Antti Karttunen, <a href="/A093653/b093653.txt">Table of n, a(n) for n = 1..16384</a> (first 500 terms from Jaroslav Krizek)

%H Maxwell Schneider and Robert Schneider, <a href="https://arxiv.org/abs/1807.06710">Digit sums and generating functions</a>, arXiv:1807.06710 [math.NT], 2018. See (22) p. 6.

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%F a(n) = Sum_{k = 0..n} if(mod(n, k) = 0, A000120(k), 0). - _Paul Barry_, Jan 14 2005

%F a(n) = A182627(n) - A226590(n). - _Jaroslav Krizek_, Sep 01 2013

%F a(n) = A292257(n) + A000120(n). - _Antti Karttunen_, Dec 14 2017

%F From _Bernard Schott_, May 16 2022: (Start)

%F If prime p = A000043(n), then a(2^p-1) = a(A000668(n)) = p+1 = A050475(n).

%F a(2^n) = n+1 (End)

%e a(8) = 4 because the divisors of 8 are [1, 2, 4, 8] and in binary: 1, 10, 100, 1000, so four 1's.

%p a:= n-> add(add(i, i=Bits[Split](d)), d=numtheory[divisors](n)):

%p seq(a(n), n=1..100); # _Alois P. Heinz_, May 17 2022

%t Table[Plus@@DigitCount[Divisors[n], 2, 1], {n, 75}] (* _Alonso del Arte_, Sep 01 2013 *)

%o (PARI) A093563(n) = sumdiv(n,d,hammingweight(d)); \\ _Antti Karttunen_, Dec 14 2017

%o (PARI) a(n) = {my(v = valuation(n, 2), n = (n>>v)); sumdiv(n, d, hammingweight(d)) * (v + 1)} \\ _David A. Corneth_, Feb 15 2023

%o (Python)

%o from sympy import divisors

%o def a(n): return sum(bin(d).count("1") for d in divisors(n))

%o print([a(n) for n in range(1, 88)]) # _Michael S. Branicky_, Apr 20 2022

%o (Python)

%o from sympy import divisors

%o def A093653(n): return sum(d.bit_count() for d in divisors(n, generator=True))

%o print([A093653(n) for n in range(1, 88)]) # _Michael S. Branicky_, Feb 15 2023

%Y Cf. A000120, A093687, A192895, A292257.

%Y Cf. A226590 (number of 0's in binary expansion of all divisors of n).

%Y Cf. A182627 (number of digits in binary expansion of all divisors of n).

%Y Cf. A034690 (a decimal equivalent).

%K base,easy,nonn

%O 1,2

%A _Jason Earls_, May 16 2004

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 16:52 EDT 2024. Contains 371794 sequences. (Running on oeis4.)