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.

A050431 Length of longest palindromic subword of (n base 3).

Original entry on oeis.org

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, 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, 3, 3, 3, 2, 2, 3, 2, 2, 3, 3, 3, 4, 4, 5, 3, 4, 4, 4, 3, 2, 2, 3
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    LPS:= proc(L) local nL, n, i;
      nL:= nops(L);
      for n from nL to 1 by -1 do
        for i from 1 to nL-n+1 do
          if L[i..i+n-1] = ListTools:-Reverse(L[i..i+n-1]) then return n fi
      od od:
    end proc:
    seq(LPS(convert(n, base, 3)), n=1..100); # Robert Israel, Dec 17 2020

Formula

a(n) <= min(a(3*n), a(3*n+1), a(3*n+2)). [Reinhard Zumkeller, Jul 31 2011]