login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A014082 Occurrences of '111' in binary expansion of n. 12
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 1, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,16

COMMENTS

a(n) = A213629(n,7) for n > 6. - Reinhard Zumkeller, Jun 17 2012

LINKS

_Reinhard Zumkeller_, Table of n, a(n) for n = 0..10000

R. Stephan, Some divide-and-conquer sequences ...

R. Stephan, Table of generating functions

Eric Weisstein's World of Mathematics, Digit Block

Index entries for sequences related to binary expansion of n

FORMULA

a(2n) = a(n), a(2n+1) = a(n) + [n congruent to 3 mod 4]. - Ralf Stephan, Aug 21 2003

G.f.: 1/(1-x) * sum(k>=0, t^7(1-t)/(1-t^8), t=x^2^k). - Ralf Stephan, Sep 08 2003

MAPLE

See A014081.

MATHEMATICA

f[n_] := Count[ Partition[ IntegerDigits[n, 2], 3, 1], {1, 1, 1}]; Table[f@n, {n, 0, 104}] [From Robert G. Wilson v, Apr 02 2009]

a[0] = a[1] = 0; a[n_] := a[n] = If[EvenQ[n], a[n/2], a[(n - 1)/2] + Boole[Mod[(n - 1)/2, 4] == 3]]; Table[a[n], {n, 0, 104}] (* Jean-François Alcover, Oct 22 2012, after Ralf Stephan *)

PROG

(Haskell)

import Data.List (tails, isPrefixOf)

a014082 = sum . map (fromEnum . ([1, 1, 1] `isPrefixOf`)) .

                    tails . a030308_row

-- Reinhard Zumkeller, Jun 17 2012

CROSSREFS

Cf. A014081, A033264, A056974, A056975, A056976, A056977, A056978, A056979, A056980.

Sequence in context: A104488 A010103 A086078 * A102354 A193138 A162641

Adjacent sequences:  A014079 A014080 A014081 * A014083 A014084 A014085

KEYWORD

nonn,easy

AUTHOR

Simon Plouffe

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified May 22 00:16 EDT 2013. Contains 225508 sequences.