The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A056978 Number of blocks of {1, 0, 0} in binary expansion of n. 11
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,36
COMMENTS
a(n) = A213629(n,4) for n > 3. - Reinhard Zumkeller, Jun 17 2012
LINKS
Eric Weisstein's World of Mathematics, Digit Block
FORMULA
a(2n) = a(n) + [n congruent to 2 mod 4], a(2n+1) = a(n). - Ralf Stephan, Aug 22 2003
MATHEMATICA
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 *)
Table[SequenceCount[IntegerDigits[n, 2], {1, 0, 0}], {n, 120}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 01 2016 *)
PROG
(Haskell)
import Data.List (tails, isPrefixOf)
a056978 = sum . map (fromEnum . ([0, 0, 1] `isPrefixOf`)) .
tails . a030308_row
-- Reinhard Zumkeller, Jun 17 2012
(PARI)
a(n) = hammingweight(bitnegimply(n>>2, bitor(n>>1, n))); \\ Gheorghe Coserea, Sep 08 2015
CROSSREFS
Sequence in context: A086075 A316865 A325616 * A321761 A037819 A090405
KEYWORD
nonn,easy
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 15 06:57 EDT 2024. Contains 372538 sequences. (Running on oeis4.)