OFFSET
1
COMMENTS
Let s = (s(n)) be a strictly increasing sequence of positive integers with infinite complement, t = (t(n)).
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.
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.
In the following list, W represents the sequence of words w(n) induced by A016777. The list includes five partitions and two permutations of the positive integers.
positions of 1-free words in W: A003462;
positions of 0-free words in W: A134342 (conjectured);
positions in W of words w(n) such that # 0's = # 1's: A342732;
positions in W of words w(n) such that # 0's < # 1's: A342733;
positions in W of words w(n) such that # 0's > # 1's: A342734;
positions in W of words w(n) such that first digit = last digit: A342735;
positions in W of words w(n) such that first digit != last digit: A342736;
length of w(n): A342739;
positions in W of words w(n) that end with 0: A342740;
positions in W of words w(n) that end with 1: A342741;
positions in W of words w(n) such that 1st digit = 0 and last digit 0: A342742;
positions in W of words w(n) such that 1st digit = 0 and last digit 1: A342743;
positions in W of words w(n) such that 1st digit = 1 and last digit 0: A342744;
positions in W of words w(n) such that 1st digit = 1 and last digit 1: A342745;
position in W of n-th positive integer (base 2): A342746;
positions in W of binary complement of w(n): A342747;
sum of digits in w(n): A342748;
number of runs in w(n): A342749;
positions in W of palindromes: A342750;
positions in W of words such that #0's - #1's is odd: A342751;
positions in W of words such that #0's - #1's is even: A342752.
For a guide to related sequences, see A341256.
EXAMPLE
The first twenty words w(n): 0, 1, 10, 00, 11, 110, 01, 100, 111, 010, 1110, 101, 000, 1100, 1111, 011, 1010, 11110, 0110, 1101.
MATHEMATICA
z = 250; s = Table[3 n - 2, {n, 1, z}] (* A016777 *)
t = Complement[Range[Max[s]], s] (* A007494 *)
s1[n_] := Length[Intersection[Range[n - 1], s]];
t1[n_] := n - 1 - s1[n];
Table[s1[n], {n, 1, z}] (* A002264 *)
Table[t1[n], {n, 1, z}] (* A004523 *)
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}] (* A341334, all binary words *)
Flatten[tt] (* A341334, words concatenated *)
Flatten[Position[Map[Union, tt], {0}]] (* A003462 *)
Flatten[Position[Map[Union, tt], {1}]] (* A134342 conjectured *)
zz = Range[Length[tt]];
Select[zz, Count[tt[[#]], 0] == Count[tt[[#]], 1] &] (* A342732 *)
Select[zz, Count[tt[[#]], 0] < Count[tt[[#]], 1] &] (* A342733 *)
Select[zz, Count[tt[[#]], 0] > Count[tt[[#]], 1] &] (* A342734 *)
Select[zz, First[tt[[#]]] == Last[tt[[#]]] &] (* A342735 *)
Select[zz, First[tt[[#]]] != Last[tt[[#]]] &] (* A342736 *)
Map[Length, tt] (* A342739 *)
Select[zz, Last[tt[[#]]] == 0 &] (* A342740 *)
Select[zz, Last[tt[[#]]] == 1 &] (* A342741 *)
Select[zz, First[tt[[#]]] == 0 && Last[tt[[#]]] == 0 &] (* A342742 *)
Select[zz, First[tt[[#]]] == 0 && Last[tt[[#]]] == 1 &] (* A342743 *)
Select[zz, First[tt[[#]]] == 1 && Last[tt[[#]]] == 0 &] (* A342744 *)
Select[zz, First[tt[[#]]] == 1 && Last[tt[[#]]] == 1 &] (* A342745 *)
d[n_] := If[First[w[n]] == 1, FromDigits[w[n], 2]];
Flatten[Table[Position[Table[d[n], {n, 1, 200}], n], {n, 1, 200}]] (* A342746 *)
comp = Flatten[Table[Position[tt, 1 - w[n]], {n, 1, 50}]] (* A342747 *)
Table[Total[w[n]], {n, 1, 100}] (* A342748 *)
Map[Length, Table[Map[Length, Split[w[n]]], {n, 1, 100}]] (* A342749 *)
Select[zz, tt[[#]] == Reverse[tt[[#]]] &] (* A342750 *)
Select[zz, OddQ[Count[w[#], 0] - Count[w[#], 1]] &] (* A342751 *)
Select[zz, EvenQ[Count[w[#], 0] - Count[w[#], 1]] &] (* A342752 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Mar 20 2021
STATUS
approved