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.
****
Guide to related sequences:
s 01-words ordered by s positions of palindromes
FORMULA
To generate successive words w(n), if n is in s, spell w(n) as 0 suffixed by the first w(k) that does not already suffix a word beginning with 0; otherwise, spell w(n) as 1 suffixed by the first w(k) that does not already suffix a word beginning with 1.
EXAMPLE
The first 20 words: 0, 1, 00, 10, 01, 11, 000, 100, 010, 110, 001, 101, 011, 111, 0000, 1000, 0100, 1100, 0010, 1010.
MATHEMATICA
z = 80; s = Table[2 n - 1, {n, 1, z}]; (* A004526 *)
t = Complement[Range[Max[s]], s]; (* A005843 *)
s1[n_] := Length[Intersection[Range[n - 1], s]];
t1[n_] := n - 1 - s1[n]; (* A023416 *)
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}] (* 01-words, in order *)
Flatten[tt] (* A341256 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Mar 16 2021
STATUS
approved