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 A033264 #59 Jun 25 2025 10:12:55 %S A033264 0,1,0,1,1,1,0,1,1,2,1,1,1,1,0,1,1,2,1,2,2,2,1,1,1,2,1,1,1,1,0,1,1,2, %T A033264 1,2,2,2,1,2,2,3,2,2,2,2,1,1,1,2,1,2,2,2,1,1,1,2,1,1,1,1,0,1,1,2,1,2, %U A033264 2,2,1,2,2,3,2,2,2,2,1,2,2,3,2,3,3,3,2,2,2,3,2,2,2,2,1,1,1,2,1,2,2,2 %N A033264 Number of blocks of {1,0} in the binary expansion of n. %C A033264 Number of i such that d(i) < d(i-1), where Sum_{d(i)*2^i: i=0,1,....,m} is base 2 representation of n. %C A033264 This is the base-2 down-variation sequence; see A297330. - _Clark Kimberling_, Jan 18 2017 %H A033264 Reinhard Zumkeller, <a href="/A033264/b033264.txt">Table of n, a(n) for n = 1..10000</a> %H A033264 Jean-Paul Allouche and Jeffrey Shallit, <a href="https://doi.org/10.1007/BFb0097122">Sums of digits and the Hurwitz zeta function</a>, in: K. Nagasaka and E. Fouvry (eds.), Analytic Number Theory, Lecture Notes in Mathematics, Vol. 1434, Springer, Berlin, Heidelberg, 1990, pp. 19-30. %H A033264 Ralf Stephan, <a href="/somedcgf.html">Some divide-and-conquer sequences with (relatively) simple ordinary generating functions</a>, 2004. %H A033264 Ralf Stephan, <a href="/A079944/a079944.ps">Table of generating functions</a>. %H A033264 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/DigitBlock.html">Digit Block</a>. %H A033264 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %F A033264 G.f.: 1/(1-x) * Sum_(k>=0, t^2/(1+t)/(1+t^2), t=x^2^k). - _Ralf Stephan_, Sep 10 2003 %F A033264 a(n) = A069010(n) - (n mod 2). - _Ralf Stephan_, Sep 10 2003 %F A033264 a(4n) = a(4n+1) = a(2n), a(4n+2) = a(n)+1, a(4n+3) = a(n). - _Ralf Stephan_, Aug 20 2003 %F A033264 a(n) = A087116(n) for n > 0, since strings of 0's alternate with strings of 1's, which end in (1,0). - _Jonathan Sondow_, Jan 17 2016 %F A033264 Sum_{n>=1} a(n)/(n*(n+1)) = Pi/4 - log(2)/2 (A196521) (Allouche and Shallit, 1990). - _Amiram Eldar_, Jun 01 2021 %p A033264 f:= proc(n) option remember; local k; %p A033264 k:= n mod 4; %p A033264 if k = 2 then procname((n-2)/4) + 1 %p A033264 elif k = 3 then procname((n-3)/4) %p A033264 else procname((n-k)/2) %p A033264 fi %p A033264 end proc: %p A033264 f(1):= 0: f(0):= q: %p A033264 seq(f(i),i=1..100); # _Robert Israel_, Aug 31 2015 %t A033264 Table[Count[Partition[IntegerDigits[n, 2], 2, 1], {1, 0}], {n, 102}] (* _Michael De Vlieger_, Aug 31 2015, after _Robert G. Wilson v_ at A014081 *) %t A033264 Table[SequenceCount[IntegerDigits[n,2],{1,0}],{n,110}] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Jan 26 2017 *) %o A033264 (Haskell) %o A033264 a033264 = f 0 . a030308_row where %o A033264 f c [] = c %o A033264 f c (0 : 1 : bs) = f (c + 1) bs %o A033264 f c (_ : bs) = f c bs %o A033264 -- _Reinhard Zumkeller_, Feb 20 2014, Jun 17 2012 %o A033264 (PARI) %o A033264 a(n) = { hammingweight(bitand(n>>1, bitneg(n))) }; \\ _Gheorghe Coserea_, Aug 30 2015 %o A033264 (Python) %o A033264 def A033264(n): return ((n>>1)&~n).bit_count() # _Chai Wah Wu_, Jun 25 2025 %Y A033264 Cf. A014081, A014082, A037800, A056974, A056975, A056976, A056977, A056978, A056979, A056980, A196521. %Y A033264 a(n) = A005811(n) - ceiling(A005811(n)/2) = A005811(n) - A069010(n). %Y A033264 Equals (A072219(n+1)-1)/2. %Y A033264 Cf. also A175047, A030308. %Y A033264 Essentially the same as A087116. %K A033264 nonn,base,easy %O A033264 1,10 %A A033264 _Clark Kimberling_