login
A397135
Number of words of length n in S, such that S is a set containing the word ab and if a word w of the form xy is in S then w* of the form x(k^r)y is in S where k^r is the reversal of some factor k of w with |k| > 1.
1
1, 0, 3, 0, 19, 22, 127, 264, 734, 1674, 3640, 7726, 15872, 32222, 64961, 130442, 261475, 523570, 1047815, 2096346, 4193451, 8387708, 16776269, 33553438, 67107823, 134216640
OFFSET
2,3
COMMENTS
Here xy is some factorization of the word w into potentially empty factors x and y.
LINKS
EXAMPLE
a(2) = 1: ab.
a(4) = 3: abab, abba, baab.
a(6) = 19: babaab, bbaaab, baabab, baabba, abbaab, baaabb, aabaab, baaaab, baabaa, ababab, ababba, aabbab, abaabb, abbaba, abbbaa, aabbba, bbabba, abbbba, abbabb.
PROG
(Python) # see links
(Python)
from itertools import count, islice
def agen(): # generator of terms
S = {2: {"ab"}}
yield 1
for n in count(3):
S[n] = set()
for i in range((n+1)//2, n-1):
for w in S[i]:
for j in range(len(w)+1):
x, y = w[:j], w[j:]
for m in range(2*i-n+1):
k = w[m:m+n-i]
S[n].add(x+k[::-1]+y)
yield len(S[n])
print(list(islice(agen(), 15))) # Michael S. Branicky, Aug 02 2026
CROSSREFS
KEYWORD
nonn,more
AUTHOR
John Tyler Rascoe, Jul 20 2026
EXTENSIONS
a(19)-a(22) from Sean A. Irvine, Jul 25 2026
a(23)-a(27) from Michael S. Branicky, Aug 02 2026
STATUS
approved