OFFSET
1,2
COMMENTS
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 and corresponding compositions begin:
0: ()
3: (1,1)
7: (1,1,1)
10: (2,2)
15: (1,1,1,1)
31: (1,1,1,1,1)
36: (3,3)
42: (2,2,2)
43: (2,2,1,1)
58: (1,1,2,2)
63: (1,1,1,1,1,1)
87: (2,2,1,1,1)
122: (1,1,1,2,2)
127: (1,1,1,1,1,1,1)
MATHEMATICA
stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
Select[Range[0, 100], !MemberQ[Length/@Split[stc[#]], 1]&]
CROSSREFS
These compositions are counted by A114901.
The case of all run-lengths = 2 is A351011.
The case of all run-lengths > 2 is counted by A353400.
A005811 counts runs in binary expansion.
A011782 counts compositions.
Statistics of standard compositions:
- Runs are counted by A124767.
- Runs-resistance is A333628.
- Run-lengths are A333769.
KEYWORD
nonn
AUTHOR
Gus Wiseman, May 16 2022
STATUS
approved