OFFSET
1,1
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.
LINKS
MathWorld, Unimodal Sequence
EXAMPLE
The terms and corresponding compositions begin:
13: (1,2,1)
22: (2,1,2)
25: (1,3,1)
27: (1,2,1,1)
29: (1,1,2,1)
38: (3,1,2)
41: (2,3,1)
44: (2,1,3)
45: (2,1,2,1)
46: (2,1,1,2)
49: (1,4,1)
50: (1,3,2)
51: (1,3,1,1)
53: (1,2,2,1)
54: (1,2,1,2)
55: (1,2,1,1,1)
57: (1,1,3,1)
59: (1,1,2,1,1)
MATHEMATICA
stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
Select[Range[0, 100], !LessEqual@@stc[#]&&!GreaterEqual@@stc[#]&]
CROSSREFS
The version for run-lengths of compositions is A332833.
A001523 counts unimodal compositions, ranks too dense.
A011782 counts compositions.
A332835 counts compositions with weakly incr. or weakly decr. run-lengths.
All of the following pertain to compositions in standard order:
- Length is A000120.
- Sum is A029837(n+1).
- Parts are listed by A066099.
- Ranks of strict compositions are A233564.
- Ranks of constant compositions are A272919.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Sep 18 2024
STATUS
approved