proposed
approved
proposed
approved
editing
proposed
Let 'D' and 'I' be the 'double' and 'increment' operators, acting on 0 from the right. Then every element of S_n can be written as a length-n word over {D,I}. E.g. , S_4 contains
proposed
editing
editing
proposed
Union];
T[n_] := T[n] = If[n==0, {0}, {#+1, 2#}& /@ T[n-1] // Flatten //
Union];
Table[T[n], {n, 0, 8}] // Flatten (* Jean-François Alcover, May 06 2022, after Alois P. Heinz *)
approved
editing
editing
approved
T:= proc(n) option remember; `if`(n=0, 0, (l-> sort(
sort([map(x-> [x+1, 2*x][], l)[]])[])({T(n-1)})[]])[])
seq(T(n), n=0..8); # Alois P. Heinz, Jan 12 2022 # _Alois P. Heinz_, Jan 12 2022
approved
editing
editing
approved
T:= proc(n) option remember; `if`(n=1, 0, 0, (l-> sort(
seq(T(n), n=10..8); # Alois P. Heinz, Jan 12 2022 # _Alois P. Heinz_, Jan 12 2022