OFFSET
0,6
COMMENTS
A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of 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 77th composition is (3,1,2,1), so a(77) = 3.
MATHEMATICA
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
Table[Length[Union[stc[n]]], {n, 0, 100}]
CROSSREFS
Number of distinct prime indices is A001221.
Positions of first appearances (offset 1) are A246534.
Positions of 1's are A272919.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Necklaces are A065609.
- Sum is A070939.
- Runs are counted by A124767.
- Rotational symmetries are counted by A138904.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Aperiodic compositions are A328594.
- Rotational period is A333632.
- Dealings are A333939.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Apr 18 2020
STATUS
approved