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.

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

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