OFFSET
1,2
COMMENTS
Also, the positions in A076478 of palindromes. - Clark Kimberling, Aug 16 2021
EXAMPLE
Among the first 20 words (0, 1, 00, 10, 01, 11, 000, 100, 010, 110, 001, 101, 011, 111, 0000, 1000, 0100, 1100, 0010, 1010), there are 9 palindromes: 0, 1, 00, 11, 000, 010, 101, 111, 0000, beginning in positions 1, 2, 3, 6, 7, 9, 12, 14, 15, respectively.
MATHEMATICA
z = 800; s = Table[2 n - 1, {n, 1, z}];
t = Complement[Range[Max[s]], s];
s1[n_] := Length[Intersection[Range[n - 1], s]];
t1[n_] := n - 1 - s1[n];
w[1] = {0}; w[t[[1]]] = {1};
w[n_] := If[MemberQ[s, n], Join[{0}, w[s1[n]]], Join[{1}, w[t1[n]]]]
tt = Table[w[n], {n, 1, z}]; Select[tt, # == Reverse[#] &]
p = Select[Range[Length[tt]], tt[[#]] == Reverse[tt[[#]]] &]
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Mar 16 2021
STATUS
approved