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!)
A050431 Length of longest palindromic subword of (n base 3). 4

%I #14 Dec 17 2020 14:26:52

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

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

%U 3,3,3,2,2,3,2,2,3,3,3,4,4,5,3,4,4,4,3,2,2,3

%N Length of longest palindromic subword of (n base 3).

%H Robert Israel, <a href="/A050431/b050431.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) <= min(a(3*n), a(3*n+1), a(3*n+2)). [_Reinhard Zumkeller_, Jul 31 2011]

%p LPS:= proc(L) local nL, n, i;

%p nL:= nops(L);

%p for n from nL to 1 by -1 do

%p for i from 1 to nL-n+1 do

%p if L[i..i+n-1] = ListTools:-Reverse(L[i..i+n-1]) then return n fi

%p od od:

%p end proc:

%p seq(LPS(convert(n, base, 3)), n=1..100); # Robert Israel, Dec 17 2020

%Y Cf. A050430, A050432, A050433.

%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 September 16 02:10 EDT 2024. Contains 375959 sequences. (Running on oeis4.)