OFFSET
1,2
EXAMPLE
Among the first 20 words (0,1,00,01,10,000,11,001,010,100,000,011,101,0001,110,0010,0100,1000,00000,111), there are 10 palindromes: 0,1,00,000,11,010,000,101,00000,111; these begin at positions 1,2,3,6,7,9,11,13,19, respectively.
MATHEMATICA
z = 800; r = (1 + Sqrt[5])/2;
s = Table[Floor[r*n], {n, 1, z}]; (* A000201 *)
t = Complement[Range[Max[s]], s]; (* A001950 *)
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[#] &];
Select[Range[Length[tt]], tt[[#]] == Reverse[tt[[#]]] &] (* A341333 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Mar 16 2021
STATUS
approved