cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A093653 #59 Jul 14 2024 17:37:32
%S A093653 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 A093653 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 A093653 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 A093653 Total number of 1's in binary expansion of all divisors of n.
%H A093653 Antti Karttunen, <a href="/A093653/b093653.txt">Table of n, a(n) for n = 1..16384</a> (first 500 terms from Jaroslav Krizek)
%H A093653 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 A093653 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A093653 a(n) = Sum_{k = 0..n} if(mod(n, k) = 0, A000120(k), 0). - _Paul Barry_, Jan 14 2005
%F A093653 a(n) = A182627(n) - A226590(n). - _Jaroslav Krizek_, Sep 01 2013
%F A093653 a(n) = A292257(n) + A000120(n). - _Antti Karttunen_, Dec 14 2017
%F A093653 From _Bernard Schott_, May 16 2022: (Start)
%F A093653 If prime p = A000043(n), then a(2^p-1) = a(A000668(n)) = p+1 = A050475(n).
%F A093653 a(2^n) = n+1 (End)
%e A093653 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 A093653 a:= n-> add(add(i, i=Bits[Split](d)), d=numtheory[divisors](n)):
%p A093653 seq(a(n), n=1..100);  # _Alois P. Heinz_, May 17 2022
%t A093653 Table[Plus@@DigitCount[Divisors[n], 2, 1], {n, 75}] (* _Alonso del Arte_, Sep 01 2013 *)
%o A093653 (PARI) A093653(n) = sumdiv(n,d,hammingweight(d)); \\ _Antti Karttunen_, Dec 14 2017
%o A093653 (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 A093653 (Python)
%o A093653 from sympy import divisors
%o A093653 def a(n): return sum(bin(d).count("1") for d in divisors(n))
%o A093653 print([a(n) for n in range(1, 88)]) # _Michael S. Branicky_, Apr 20 2022
%o A093653 (Python)
%o A093653 from sympy import divisors
%o A093653 def A093653(n): return sum(d.bit_count() for d in divisors(n, generator=True))
%o A093653 print([A093653(n) for n in range(1, 88)]) # _Michael S. Branicky_, Feb 15 2023
%Y A093653 Cf. A000120, A093687, A192895, A292257.
%Y A093653 Cf. A226590 (number of 0's in binary expansion of all divisors of n).
%Y A093653 Cf. A182627 (number of digits in binary expansion of all divisors of n).
%Y A093653 Cf. A034690 (a decimal equivalent).
%K A093653 base,easy,nonn
%O A093653 1,2
%A A093653 _Jason Earls_, May 16 2004