Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #19 Sep 20 2023 17:56:48
%S 1,1,1,1,2,1,1,1,1,2,1,1,1,1,2,2,1,1,1,2,3,2,2,1,1,2,1,1,1,1,2,2,1,1,
%T 1,1,2,1,1,2,2,3,2,1,1,1,2,2,1,1,1,1,2,1,1,1,1,2,1,2,2,2,3,3,2,2,2,1,
%U 2,1,1,1,1,2,1,1,1,1,2,2,2,2,2,3,4,3,3,2,2,2
%N Maximal run length in base 4 representation of n.
%C Sequences A031942 (or A043090), A037977, A037978, A037979 list numbers for which a(n)=1, a(n)=2, a(n)=3, a(n)=4. - _M. F. Hasler_, Jul 23 2013
%H Winston de Greef, <a href="/A043278/b043278.txt">Table of n, a(n) for n = 1..10000</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 A043278 := proc(n)
%p convert(n,base,4) ;
%p mRunLen(%) ;
%p end proc: # _R. J. Mathar_, Jul 26 2015
%t Table[Max[Length/@Split[IntegerDigits[n,4]]],{n,100}] (* _Harvey P. Dale_, Jan 21 2014 *)
%o (PARI) A043278(n, b=4)={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,5
%A _Clark Kimberling_