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.
%I A301896 #13 Nov 11 2024 22:27:26 %S A301896 0,1,4,8,20,35,54,72,117,165,221,280,352,425,504,576,726,875,1036, %T A301896 1200,1386,1575,1776,1976,2214,2451,2700,2944,3216,3479,3750,4000, %U A301896 4455,4897,5355,5808,6300,6789,7296,7800,8364,8925,9504,10080,10695,11305,11931,12544,13260,13965,14688 %N A301896 a(n) = product of total number of 0's and total number of 1's in binary expansions of 0, ..., n. %H A301896 Alois P. Heinz, <a href="/A301896/b301896.txt">Table of n, a(n) for n = 0..10000</a> %H A301896 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %F A301896 a(n) = A059015(n)*A000788(n). %F A301896 a(2^k-1) = 2^(k-2)*(2^k*(k - 2) + 4)*k. %e A301896 +---+-----+---+---+---+---+----------+ %e A301896 | n | bin.|0's|sum|1's|sum| a(n) | %e A301896 +---+-----+---+---+---+---+----------+ %e A301896 | 0 | 0 | 1 | 1 | 0 | 0 | 1*0 = 0 | %e A301896 | 1 | 1 | 0 | 1 | 1 | 1 | 1*1 = 1 | %e A301896 | 2 | 10 | 1 | 2 | 1 | 2 | 2*2 = 4 | %e A301896 | 3 | 11 | 0 | 2 | 2 | 4 | 2*4 = 8 | %e A301896 | 4 | 100 | 2 | 4 | 1 | 5 | 4*5 = 20 | %e A301896 | 5 | 101 | 1 | 5 | 2 | 7 | 5*7 = 35 | %e A301896 | 6 | 110 | 1 | 6 | 2 | 9 | 6*9 = 54 | %e A301896 +---+-----+---+---+---+---+----------+ %e A301896 bin. - n written in base 2; %e A301896 0's - number of 0's in binary expansion of n; %e A301896 1's - number of 1's in binary expansion of n; %e A301896 sum - total number of 0's (or 1's) in binary expansions of 0, ..., n. %p A301896 b:= proc(n) option remember; `if`(n=0, [1, 0], b(n-1)+ %p A301896 (l-> [add(1-i, i=l), add(i, i=l)])(Bits[Split](n))) %p A301896 end: %p A301896 a:= n-> (l-> l[1]*l[2])(b(n)): %p A301896 seq(a(n), n=0..50); # _Alois P. Heinz_, Mar 01 2023 %t A301896 Accumulate[DigitCount[Range[0, 50], 2, 0]] Accumulate[DigitCount[Range[0, 50], 2, 1]] %o A301896 (Python) %o A301896 def A301896(n): return (2+(n+1)*(m:=(n+1).bit_length())-(1<<m)-(k:=sum(i.bit_count() for i in range(1,n+1))))*k # _Chai Wah Wu_, Mar 01 2023 %o A301896 (Python) %o A301896 def A301896(n): return (a:=(n+1)*n.bit_count()+(sum((m:=1<<j)*((k:=n>>j)-(r if n<<1>=m*(r:=k<<1|1) else 0)) for j in range(1,n.bit_length()+1))>>1))*(2+(n+1)*(t:=(n+1).bit_length())-(1<<t)-a) # _Chai Wah Wu_, Nov 11 2024 %Y A301896 Cf. A000120, A000788, A023416, A059015, A071295, A301336. %K A301896 nonn,base %O A301896 0,3 %A A301896 _Ilya Gutkovskiy_, Mar 28 2018