OFFSET
1,1
COMMENTS
A square is a nonempty block of the form XX, where X is a block.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..40
Rémy Sigrist, C program for A323442
EXAMPLE
For n = 6 the 8 examples are {010001,011001,011101,011110} and their complements.
PROG
(C) See Links section.
(Python)
from itertools import product as prod
def c(w): # string w begins or ends with a square
if any(w[:i] == w[i:2*i] for i in range(1, len(w)//2+1)): return True
if any(w[-i:] == w[-2*i:-i] for i in range(1, len(w)//2+1)): return True
return False
def a(n):
return sum(2 for b in prod("01", repeat=n-1) if not c("0"+"".join(b)))
print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Jul 04 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Jeffrey Shallit, Jan 15 2019
EXTENSIONS
a(21)-a(36) from Lars Blomberg, Jan 17 2019
STATUS
approved