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

 

Logo

Please make a donation to keep the OEIS running. We are now in our 55th year. In the past year we added 12000 new sequences and reached 8000 citations (which often say "discovered thanks to the OEIS"). We need to raise money to hire someone to manage submissions, which would reduce the load on our editors and speed up editing.
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A043276 a(n) = maximal run length in base-2 representation of n. 32
1, 1, 2, 2, 1, 2, 3, 3, 2, 1, 2, 2, 2, 3, 4, 4, 3, 2, 2, 2, 1, 2, 3, 3, 2, 2, 2, 3, 3, 4, 5, 5, 4, 3, 3, 2, 2, 2, 3, 3, 2, 1, 2, 2, 2, 3, 4, 4, 3, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 5, 6, 6, 5, 4, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 3, 4, 4, 3, 2, 2, 2, 1, 2, 3, 3, 2, 2, 2, 3, 3, 4, 5, 5, 4, 3, 3, 2, 2, 2, 3, 3, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

First occurrence of k is when n=2^k-1 and there is no last occurrence. - Robert G. Wilson v, Dec 14 2008

Sequences A000975, A037969, A037970, A037971 list numbers for which a(n)=1, a(n)=2, a(n)=3, a(n)=4. - M. F. Hasler, Jul 23 2013

a(n) = max(A101211(n,k): k = 1..A005811(n)). - Reinhard Zumkeller, Dec 16 2013

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 1..10000

MATHEMATICA

f[n_] := Max @@ Length /@ Split@IntegerDigits[n, 2]; Array[f, 105] (* Robert G. Wilson v, Dec 14 2008 *)

PROG

(PARI) A043276(n, b=2)={my(m, c=1); while(n>0, n%b==(n\=b)%b && c++ && next; m=max(m, c); c=1); m} \\ - M. F. Hasler, Jul 23 2013

(PARI) a(n)=my(r, t); while(n, t=valuation(n, 2); if(t>r, r=t); n>>=t; t=valuation(n+1, 2); if(t>r, r=t); n>>=t); r \\ Charles R Greathouse IV, Nov 02 2016

(Haskell)

a043276 = maximum . a101211_row  -- Reinhard Zumkeller, Dec 16 2013

CROSSREFS

Cf. A043277-A043290 for base-3 to base-16 analogs.

Sequence in context: A106580 A165915 A269783 * A319416 A284559 A284583

Adjacent sequences:  A043273 A043274 A043275 * A043277 A043278 A043279

KEYWORD

nonn,base,look

AUTHOR

Clark Kimberling

EXTENSIONS

More terms from Robert G. Wilson v, Dec 14 2008

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 12 15:11 EST 2019. Contains 329960 sequences. (Running on oeis4.)