login
Positions of palindromes in the ordering of all 01-words defined at A341258.
3

%I #5 Mar 19 2021 00:03:30

%S 1,2,3,6,7,9,11,13,19,20,23,25,29,32,39,43,53,54,60,65,67,72,76,82,87,

%T 91,107,119,126,142,143,151,157,167,175,177,187,195,199,207,213,223,

%U 231,248,259,285,292,318,338,349,375,376,392,405,411,424,434,450

%N Positions of palindromes in the ordering of all 01-words defined at A341258.

%e 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.

%t z = 800; r = (1 + Sqrt[5])/2;

%t s = Table[Floor[r*n], {n, 1, z}]; (* A000201 *)

%t t = Complement[Range[Max[s]], s]; (* A001950 *)

%t s1[n_] := Length[Intersection[Range[n - 1], s]];

%t t1[n_] := n - 1 - s1[n];

%t w[1] = {0}; w[t[[1]]] = {1};

%t w[n_] := If[MemberQ[s, n], Join[{0}, w[s1[n]]], Join[{1}, w[t1[n]]]]

%t tt = Table[w[n], {n, 1, z}]; Select[tt, # == Reverse[#] &];

%t Select[Range[Length[tt]], tt[[#]] == Reverse[tt[[#]]] &] (* A341333 *)

%Y Cf. A341258.

%K nonn

%O 1,2

%A _Clark Kimberling_, Mar 16 2021