Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%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_