login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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
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
D. Kempa and N. Prezza. At the roots of dictionary compression: string attractors. In STOC’18 Proceedings, ACM Press, 2018, pp. 827-840.
FORMULA
a(n) = A355520(n) - 2, since only 0^n and 1^n possess string attractors of size 1. - Michael S. Branicky, Jul 06 2022
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))
print([a(n) for n in range(1, 12)]) # Michael S. Branicky, Dec 20 2020
CROSSREFS
Sequence in context: A284023 A366542 A192966 * A260058 A331699 A327048
KEYWORD
nonn,more
AUTHOR
Jeffrey Shallit, Dec 12 2020
EXTENSIONS
a(19)-a(20) from Michael S. Branicky, Dec 20 2020
a(21) from Michael S. Branicky, Jul 06 2022
STATUS
approved