|
|
A339668
|
|
Number of length-n binary strings having minimum string attractor size 2.
|
|
1
|
|
|
0, 2, 6, 14, 30, 60, 114, 204, 348, 564, 884, 1332, 1972, 2844, 3976, 5470, 7396, 9852, 12962, 16802, 21522
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
A set S of positions of a string w[1..n] is called a "string attractor" if every nonempty contiguous block occurring in w has an occurrence in w that touches at least one of the positions of S. For example, "alfalfa" has a string attractor of size 3: {3,4,5}.
|
|
LINKS
|
|
|
FORMULA
|
|
|
PROG
|
(Python) # needs subroutines in A339391
from itertools import product, combinations
def lsa_is_2(w): # length of smallest attractor of w is 2
for r in range(1, 3):
for s in combinations(range(len(w)), r):
if is_attractor(set(s), w): return r == 2
return False
def a(n): # twice value of strings starting with 0 by symmetry
return 2*sum(lsa_is_2("0"+"".join(u)) for u in product("01", repeat=n-1))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|