OFFSET
1,3
COMMENTS
A set of indices is symmetric if, listed in increasing or decreasing order, its first differences are a palindromic sequence.
A new value is always followed by 1.
An alternate definition: a(n) is the largest number of coincidences between the subsequence enclosed by m..n-1 and its reverse, where a(n-1)=a(m), maximized over m.
LINKS
Neal Gersh Tolunsky, Table of n, a(n) for n = 1..10000
Neal Gersh Tolunsky, Ordinal transform of first 30000 terms.
Neal Gersh Tolunsky, Graph of first 100000 terms.
EXAMPLE
a(10)=5 because we find the following length-5 palindromic subsequence at symmetric indices ending at i=a(n-1)=a(9)=2:
S: 1,1,2,1,3,1,3,3,2
P: 2, 3,1,3, 2
a(14)=6 because of the following length-6 palindromic subsequence:
S: 1,1,2,1,3,1,3,3,2,5,1,7,1
P: 1, 1, 3,3, 1, 1
PROG
(PARI) { for (n = 1, #a = vector(83, n, 1), for (k = 1, n-1, if (a[k] == a[n-1], a[n] = max(a[n], sum (i = k, n-1, a[i] == a[n-1+k-i]); ); ); ); print1 (a[n]", "); ); } \\ Rémy Sigrist, Dec 20 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Neal Gersh Tolunsky, Dec 19 2023
EXTENSIONS
More terms from Rémy Sigrist, Dec 20 2023
STATUS
approved
