OFFSET
1,2
COMMENTS
A square is a nonempty block of the form XX, where X is any block.
LINKS
Rémy Sigrist, C++ program
EXAMPLE
For n = 5, the possible sets are {2,4} (for 0000); {2} (for 0011); {4} (for 0101); and the empty set.
PROG
(C++) See Links section.
(Python)
from itertools import product
def a(n): return len(set(tuple(l for l in range(n//2) if w[l] == "0" and w[:l] == w[l+1:2*l+1]) for w in product("01", repeat=n-1)))
print([a(n) for n in range(1, 22)]) # Michael S. Branicky, Jul 23 2022
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Jeffrey Shallit, Jan 17 2019
EXTENSIONS
a(22)-a(37) from Rémy Sigrist, Jan 19 2019
STATUS
approved