OFFSET
1,4
COMMENTS
a(n) is the number of n-digit singular subwords of the Thue-Morse word A010060 that end with 0; a subword w is singular if exactly one of the words w0 and w1 is also a subword.
EXAMPLE
The six 3-digit subwords of A010060 are 001, 010, 011, 100, 101, 110. Each, except for 011 and 100, is the initial 3-letter word of two 4-letter subwords. Thus, a(3) = 1.
MATHEMATICA
TM = Nest[Flatten[# /. {0 -> {0, 1}, 1 -> {1, 0}}] &, {0}, 12]; (* A010060 *)
t[k_, n_] := t[k, n] = Take[TM, {n, n + k - 1}];
c[k_] := c[k] = Union[Table[t[k, n], {n, 1, Length[TM] - k + 1}]];
s[n_] := s[n] = Select[c[n], ! MemberQ[c[n + 1],
Join[#, {0}]] || !MemberQ[c[n + 1], Join[#, {1}]] &]
Table[s[n], {n, 1, 8}]
u = Table[Length[s[n]], {n, 1, 60}] (* A343984 *)
u/2 (* A343985 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, May 07 2021
STATUS
approved