login
Concatenation of all 01-words, in the order induced by A001651; see Comments.
31

%I #12 Jun 04 2021 09:50:13

%S 0,0,0,1,0,0,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,

%T 1,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,1,1,0,0,0,0,1,1,1,0,0,

%U 0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1

%N Concatenation of all 01-words, in the order induced by A001651; see Comments.

%C Let s = (s(n)) be a strictly increasing sequence of positive integers with infinite complement, t = (t(n)).

%C For n >=1, let s'(n) be the number of s(i) that are <= n-1 and let t'(n) be the number of t(i) that are <= n-1.

%C Define w(1) = 0, w(t(1)) = 1, and w(n) = 0w(s'(n)) if n is in s, and w(n) = 1w(t'(n)) if n is in t. Then (w(n)) is the "s-induced ordering" of all 01-words.

%C s = A001651; t = A008585; s' = A004523; t' = A002264;

%C In the following list, W represents the sequence of words w(n) induced by A001651. The list includes five partitions and two permutations of the positive integers.

%C positions of 1-free words in W: A006999;

%C positions of 0-free words in W: A029858;

%C length of w(n): A342774;

%C positions in W of words w(n) such that # 0's = # 1's: A342775;

%C positions in W of words w(n) such that # 0's < # 1's: A342776;

%C positions in W of words w(n) such that # 0's > # 1's: A342777;

%C positions in W of words having last digit 0: A342778;

%C positions in W of words having last digit 1: A342779;

%C positions in W of words w(n) such that first digit = last digit: A342780;

%C positions in W of words w(n) such that first digit != last digit: A342781;

%C positions in W of words w(n) such that 1st digit = 0 and last digit 0: A342748;

%C positions in W of words w(n) such that 1st digit = 0 and last digit 1: A342783;

%C positions in W of words w(n) such that 1st digit = 1 and last digit 0: A342784;

%C positions in W of words w(n) such that 1st digit = 1 and last digit 1: A342785;

%C position in W of n-th positive integer (base 2): A342786;

%C positions in W of binary complement of w(n): A342787;

%C sum of digits in w(n): A342788;

%C number of runs in w(n): A342789;

%C positions in W of palindromes: A342790;

%C positions in W of words such that #0's - #1's is odd: A342791;

%C positions in W of words such that #0's - #1's is even: A342792.

%C position in W of the reversal of the n-th word in A342798.

%C For a guide to related sequences, see A341256.

%e The first 16 words w(n): 0, 00, 1, 000, 01, 10, 0000, 001, 100, 010, 00000, 11, 0001, 0100, 1000, 0010.

%t z = 100; s = Table[Floor[(3 n - 1)/2], {n, 1, z}]; (* A001651 *)

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

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

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

%t Table[s1[n], {n, 1, z}]; (* A004523 *)

%t Table[t1[n], {n, 1, z}]; (* A002264 *)

%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}] (* A342753, words *)

%t Flatten[tt] (* A342753, concatenated *)

%t Map[Length, tt] (* A342774 *)

%t Flatten[Position[Map[Union, tt], {0}]]; (* A006999 *)

%t Flatten[Position[Map[Union, tt], {1}]]; (* A029858 *)

%t zz = Range[Length[tt]];

%t Select[zz, Count[tt[[#]], 0] == Count[tt[[#]], 1] &] (* A342775 *)

%t Select[zz, Count[tt[[#]], 0] < Count[tt[[#]], 1] &] (* A342776 *)

%t Select[zz, Count[tt[[#]], 0] > Count[tt[[#]], 1] &] (* A342777 *)

%t Select[zz, Last[tt[[#]]] == 0 &] (* A342778 *)

%t Select[zz, Last[tt[[#]]] == 1 &] (* A342779 *)

%t Select[zz, First[tt[[#]]] == Last[tt[[#]]] &] (* A342780 *)

%t Select[zz, First[tt[[#]]] != Last[tt[[#]]] &] (* A342781 *)

%t Select[zz, First[tt[[#]]] == 0 && Last[tt[[#]]] == 0 &] (* A342782 *)

%t Select[zz, First[tt[[#]]] == 0 && Last[tt[[#]]] == 1 &] (* A342783 *)

%t Select[zz, First[tt[[#]]] == 1 && Last[tt[[#]]] == 0 &] (* A342784 *)

%t Select[zz, First[tt[[#]]] == 1 && Last[tt[[#]]] == 1 &] (* A342785 *)

%t d[n_] := If[First[w[n]] == 1, FromDigits[w[n], 2]];

%t Flatten[Table[Position[Table[d[n], {n, 1, 200}], n], {n, 1, 200}]] (* A342786 *)

%t comp = Flatten[Table[Position[tt, 1 - w[n]], {n, 1, 50}]] (* A342787 *)

%t Table[Total[w[n]], {n, 1, 100}] (* A342788 *)

%t Map[Length, Table[Map[Length, Split[w[n]]], {n, 1, 100}]] (* A342789 *)

%t Select[zz, tt[[#]] == Reverse[tt[[#]]] &] (* A342790 *)

%t Select[zz, OddQ[Count[w[#], 0] - Count[w[#], 1]] &] (* A342791 *)

%t Select[zz, EvenQ[Count[w[#], 0] - Count[w[#], 1]] &] (* A342792 *)

%t Flatten[Table[Position[tt, Reverse[w[n]]], {n, 1, 150}]]; (* A342798 *)

%Y Cf. A001651, A341256, A342910.

%K nonn,base

%O 1

%A _Clark Kimberling_, Apr 10 2021