OFFSET
1,3
COMMENTS
First differs from the non-consecutive version A353431 in lacking 22318, corresponding to the binary word 101011100101110 and standard composition (2,2,1,1,3,2,1,1,2), whose run-lengths (2,2,1,1,2,1) are a subsequence but not a consecutive subsequence.
The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.
EXAMPLE
The terms together with their corresponding compositions begin:
0: ()
1: (1)
2: (2)
4: (3)
8: (4)
10: (2,2)
16: (5)
32: (6)
43: (2,2,1,1)
58: (1,1,2,2)
64: (7)
128: (8)
256: (9)
292: (3,3,3)
349: (2,2,1,1,2,1)
442: (1,2,1,1,2,2)
512: (10)
586: (3,3,2,2)
676: (2,2,3,3)
697: (2,2,1,1,3,1)
826: (1,3,1,1,2,2)
MATHEMATICA
stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
yoyQ[y_]:=Length[y]<=1||MemberQ[Join@@Table[Take[y, {i, j}], {i, Length[y]}, {j, i, Length[y]}], Length/@Split[y]]&&yoyQ[Length/@Split[y]];
Select[Range[0, 1000], yoyQ[stc[#]]&]
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, May 22 2022
STATUS
approved