cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A043277 Maximal run length in base 3 representation of n.

This page as a plain text file.
%I A043277 #16 Aug 24 2019 10:02:52
%S A043277 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 A043277 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 A043277 1,1,2,2,2,2,2,2,2,3,3,4,4,3,3,2,2,2,2,2,2,2
%N A043277 Maximal run length in base 3 representation of n.
%C A043277 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 A043277 A003462 gives the positions of records. - _R. J. Mathar_, Jul 26 2015
%H A043277 R. J. Mathar, <a href="/A043277/b043277.txt">Table of n, a(n) for n = 1..1000</a>
%p A043277 mRunLen := proc(L)
%p A043277     if nops(L) = 0 then
%p A043277         0;
%p A043277     else
%p A043277         a := 1 ;
%p A043277         for i from 2 to nops(L) do
%p A043277             if op(i,L) = op(i-1,L) then
%p A043277                 a := a+1 ;
%p A043277             else
%p A043277                 a := max(a, procname([op(i..nops(L),L)])) ;
%p A043277                 break;
%p A043277             end if;
%p A043277         end do:
%p A043277         a ;
%p A043277     end if ;
%p A043277 end proc:
%p A043277 A043277 := proc(n)
%p A043277     convert(n,base,3) ;
%p A043277     mRunLen(%) ;
%p A043277 end proc:
%p A043277 seq(A043277(n),n=1..100) ; # _R. J. Mathar_, Jul 26 2015
%t A043277 Table[Max[Length/@Split[IntegerDigits[n,3]]],{n,90}] (* _Harvey P. Dale_, Aug 24 2019 *)
%o A043277 (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 A043277 Cf. A043276-A043290 for base-2 to base-16 analogs.
%K A043277 nonn,base
%O A043277 1,4
%A A043277 _Clark Kimberling_