Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A038374
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A038374 Length of longest contiguous block of 1's in binary expansion of n. +0
10
1, 1, 2, 1, 1, 2, 3, 1, 1, 1, 2, 2, 2, 3, 4, 1, 1, 1, 2, 1, 1, 2, 3, 2, 2, 2, 2, 3, 3, 4, 5, 1, 1, 1, 2, 1, 1, 2, 3, 1, 1, 1, 2, 2, 2, 3, 4, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 5, 6, 1, 1, 1, 2, 1, 1, 2, 3, 1, 1, 1, 2, 2, 2, 3, 4, 1, 1, 1, 2, 1, 1, 2, 3, 2, 2, 2 (list; graph; listen)
OFFSET

1,3

FORMULA

a(n) >= A089309(n). a(n) >= A089310(n). a(2^i)=1. a(2^i-1)=i. - R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Jun 15 2006

EXAMPLE

a(157) = 3 because 157 in base 2 is 10011101, and longest contiguous block of 1's is of length 3.

MAPLE

A0838374 := proc(n) local nshft, thisr, resul; nshft := n ; resul :=0 ; thisr :=0 ; while nshft > 0 do if nshft mod 2 <> 0 then thisr := thisr+1 ; else resul := max(resul, thisr) ; thisr := 0 ; fi ; nshft := floor(nshft/2) ; od ; resul := max(resul, thisr) ; RETURN(resul) ; end : for n from 1 to 80 do printf("%d, ", A0838374(n)) ; od : - R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Jun 15 2006

CROSSREFS

Cf. A087117, A090000, A090001, A090002, A090003, A090050.

Sequence in context: A090996 A089309 A126387 this_sequence A136277 A133233 A116361

Adjacent sequences: A038371 A038372 A038373 this_sequence A038375 A038376 A038377

KEYWORD

base,easy,nonn

AUTHOR

Jeffrey Shallit (shallit(AT)uwaterloo.ca)

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified August 19 23:53 EDT 2008. Contains 142930 sequences.


AT&T Labs Research