|
|
A343435
|
|
Maximum value of the number of different internal squarefree extensions for words of length n in the set of all finite squarefree words over the alphabet A3 = {1,2,3}.
|
|
3
|
|
|
2, 3, 4, 3, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 11, 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 16, 16, 16, 16, 16, 17
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
3,1
|
|
LINKS
|
|
|
PROG
|
(Python)
def isf(w): # incrementally squarefree (check factors ending in last letter)
for l in range(1, len(w)//2 + 1):
if w[-2*l:-l] == w[-l:]: return False
return True
def ae(w, sfsnew): # number of internal square free extensions of w
return len(set(x for x in (w[:i]+c+w[i:] for c in "123" for i in range(1, len(w))) if x in sfsnew))
def aupton(nn):
alst, sfs = [], set("123")
for n in range(1, nn+1):
sfsnew = set(w+c for w in sfs for c in "123" if isf(w+c))
if n >= 3: alst.append(max(ae(w, sfsnew) for w in sfs))
sfs = sfsnew
return alst
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|