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.

A056980 Number of blocks of {1, 1, 0} in binary expansion of n.

This page as a plain text file.
%I A056980 #26 Feb 16 2025 08:32:43
%S A056980 0,0,0,0,0,1,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,0,0,0,0,
%T A056980 0,0,0,1,0,0,0,0,0,1,1,1,0,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
%U A056980 0,1,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,2
%N A056980 Number of blocks of {1, 1, 0} in binary expansion of n.
%H A056980 Reinhard Zumkeller, <a href="/A056980/b056980.txt">Table of n, a(n) for n = 1..10000</a>
%H A056980 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/DigitBlock.html">Digit Block</a>.
%F A056980 a(2n) = a(n) + [n congruent to 3 mod 4], a(2n+1) = a(n). - _Ralf Stephan_, Aug 22 2003
%F A056980 a(n) = A213629(n,6) for n > 5. - _Reinhard Zumkeller_, Jun 17 2012
%t A056980 a[1] = a[2] = 0; a[n_] := a[n] = If[OddQ[n], a[(n - 1)/2], a[n/2] + Boole[Mod[n/2, 4] == 3]]; Table[a[n], {n, 1, 102}] (* _Jean-François Alcover_, Oct 22 2012, after _Ralf Stephan_ *)
%o A056980 (Haskell)
%o A056980 import Data.List (tails, isPrefixOf)
%o A056980 a056980 = sum . map (fromEnum . ([0,1,1] `isPrefixOf`)) .
%o A056980                     tails . a030308_row
%o A056980 -- _Reinhard Zumkeller_, Jun 17 2012
%o A056980 (PARI)
%o A056980 a(n) = hammingweight(bitnegimply(bitand(n>>1, n>>2), n));
%o A056980 vector(102, i, a(i))  \\  _Gheorghe Coserea_, Sep 07 2015
%Y A056980 Cf. A014082, A056974, A056975, A056976, A056977, A056978, A056979.
%Y A056980 Cf. A213629.
%K A056980 nonn,easy,base
%O A056980 1,54
%A A056980 _Eric W. Weisstein_