%I #18 May 03 2019 18:25:08
%S 0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,
%T 1,0,0,1,1,0,0,0,1,1,1,1,1,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,1,0,
%U 0,1,1,0,0,0,1,1,1,1,1,0,0,0,1,0,0,1,1,1,1,1,2,1,1,1,1,0,0,0,1,0,0,1
%N Number of blocks of {0, 1, 1} in binary expansion of n.
%H Gheorghe Coserea, <a href="/A056977/b056977.txt">Table of n, a(n) for n = 1..10000</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/DigitBlock.html">Digit Block</a>
%F a(2n) = a(n), a(2n+1) = a(n) + [n>1 and n congruent to 1 mod 4]. - _Ralf Stephan_, Aug 22 2003
%t a[n_, bits_] := (idn = IntegerDigits[n, 2]; ln = Length[idn]; lb = Length[bits]; For[cnt = 0; k = 1, k <= ln - lb + 1, k++, If[idn[[k ;; k + lb - 1]] == bits, cnt++]]; cnt); Table[ a[n, {0, 1, 1}], {n, 1, 102} ] (* _Jean-François Alcover_, Oct 23 2012 *)
%t Table[SequenceCount[IntegerDigits[n,2],{0,1,1}],{n,120}] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, May 03 2019 *)
%o (PARI)
%o a(n) = {
%o if (n < 11, return(0));
%o my(k = logint(n,2) - 1);
%o hammingweight(bitnegimply(bitand(n>>1, n), n>>2)) - bittest(n,k)
%o };
%o vector(102, i, a(i)) \\ _Gheorghe Coserea_, Sep 17 2015
%Y Cf. A014082, A056974, A056975, A056976, A056977, A056978, A056979, A056980.
%K nonn,easy
%O 1,91
%A _Eric W. Weisstein_