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!)
A043277 Maximal run length in base 3 representation of n. 9

%I #16 Aug 24 2019 10:02:52

%S 1,1,1,2,1,1,1,2,2,1,1,2,3,2,1,1,2,2,1,1,1,2,1,2,2,3,3,2,2,1,2,1,1,1,

%T 2,2,2,2,3,4,3,2,2,2,2,1,1,1,2,1,2,2,3,3,2,2,1,2,1,1,1,2,2,1,1,2,3,2,

%U 1,1,2,2,2,2,2,2,2,3,3,4,4,3,3,2,2,2,2,2,2,2

%N Maximal run length in base 3 representation of n.

%C Sequences A031941, A037973, A037974, A037975 list numbers for which a(n)=1, a(n)=2, a(n)=3, a(n)=4. - _M. F. Hasler_, Jul 23 2013

%C A003462 gives the positions of records. - _R. J. Mathar_, Jul 26 2015

%H R. J. Mathar, <a href="/A043277/b043277.txt">Table of n, a(n) for n = 1..1000</a>

%p mRunLen := proc(L)

%p if nops(L) = 0 then

%p 0;

%p else

%p a := 1 ;

%p for i from 2 to nops(L) do

%p if op(i,L) = op(i-1,L) then

%p a := a+1 ;

%p else

%p a := max(a, procname([op(i..nops(L),L)])) ;

%p break;

%p end if;

%p end do:

%p a ;

%p end if ;

%p end proc:

%p A043277 := proc(n)

%p convert(n,base,3) ;

%p mRunLen(%) ;

%p end proc:

%p seq(A043277(n),n=1..100) ; # _R. J. Mathar_, Jul 26 2015

%t Table[Max[Length/@Split[IntegerDigits[n,3]]],{n,90}] (* _Harvey P. Dale_, Aug 24 2019 *)

%o (PARI) A043277(n, b=3)={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

%Y Cf. A043276-A043290 for base-2 to base-16 analogs.

%K nonn,base

%O 1,4

%A _Clark Kimberling_

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 April 23 02:53 EDT 2024. Contains 371906 sequences. (Running on oeis4.)