%I #19 Jul 24 2022 02:31:02
%S 1,2,2,4,4,7,7,11,11,17,17,25,25,36,36,50,50,68,68,90,90,121,121,154,
%T 154,200,200,256,256,319,319,395,395,494,494,599,599
%N Number of distinct sets of lengths of squares that are prefixes of a length-n binary word.
%C A square is a nonempty block of the form XX, where X is any block.
%H Rémy Sigrist, <a href="/A323539/a323539.txt">C++ program</a>
%e For n = 5, the possible sets are {2,4} (for 0000); {2} (for 0011); {4} (for 0101); and the empty set.
%o (C++) See Links section.
%o (Python)
%o from itertools import product
%o 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)))
%o print([a(n) for n in range(1, 22)]) # _Michael S. Branicky_, Jul 23 2022
%Y Similar to, but not the same as A277133.
%K nonn,more
%O 1,2
%A _Jeffrey Shallit_, Jan 17 2019
%E a(22)-a(37) from _Rémy Sigrist_, Jan 19 2019
|