%I #34 Aug 10 2023 17:30:42
%S 0,0,0,0,0,1,0,0,0,1,1,1,0,1,0,0,0,1,1,1,1,2,1,1,0,1,1,1,0,1,0,0,0,1,
%T 1,1,1,2,1,1,1,2,2,2,1,2,1,1,0,1,1,1,1,2,1,1,0,1,1,1,0,1,0,0,0,1,1,1,
%U 1,2,1,1,1,2,2,2,1,2,1,1,1,2,2,2,2,3,2,2,1,2,2,2,1,2,1,1,0,1,1,1,1,2,1
%N Number of occurrences of 01 in the binary expansion of n.
%C 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 This is the base-2 up-variation sequence; see A297330. - _Clark Kimberling_, Jan 18 2017
%H Reinhard Zumkeller, <a href="/A037800/b037800.txt">Table of n, a(n) for n = 0..10000</a>
%H 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 Ralf Stephan, <a href="/somedcgf.html">Some divide-and-conquer sequences with (relatively) simple ordinary generating functions</a>, 2004.
%H Ralf Stephan, <a href="/A079944/a079944.ps">Table of generating functions</a>.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/DigitBlock.html">Digit Block</a>.
%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F a(2n) = a(n), a(2n+1) = a(n) + [n is even]. - _Ralf Stephan_, Aug 21 2003
%F G.f.: 1/(1-x) * Sum_{k>=0} t^5/(1+t)/(1+t^2) where t=x^2^k. - _Ralf Stephan_, Sep 10 2003
%F a(n) = A069010(n) - 1, n>0. - _Ralf Stephan_, Sep 10 2003
%F Sum_{n>=1} a(n)/(n*(n+1)) = log(2)/2 + Pi/4 - 1 = A231902 - 1 (Allouche and Shallit, 1990). - _Amiram Eldar_, Jun 01 2021
%t Table[SequenceCount[IntegerDigits[n,2],{0,1}],{n,0,120}] (* _Harvey P. Dale_, Aug 10 2023 *)
%o (Haskell)
%o a037800 = f 0 . a030308_row where
%o f c [_] = c
%o f c (1 : 0 : bs) = f (c + 1) bs
%o f c (_ : bs) = f c bs
%o -- _Reinhard Zumkeller_, Feb 20 2014
%o (PARI)
%o a(n) = { if(n == 0, 0, -1 + hammingweight(bitnegimply(n, n>>1))) }; \\ _Gheorghe Coserea_, Aug 31 2015
%Y Cf. A014081, A014082, A033264, A056974, A056975, A056976, A056977, A056978, A056979, A056980.
%Y Cf. A030308, A231902.
%K nonn,base,easy
%O 0,22
%A _Clark Kimberling_