login
A357138
Minimal run-length of the n-th composition in standard order; a(0) = 0.
3
0, 1, 1, 2, 1, 1, 1, 3, 1, 1, 2, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
OFFSET
0,4
COMMENTS
A composition of n is a finite sequence of positive integers summing to n. 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
Composition 92 in standard order is (2,1,1,3), so a(92) = 1.
MATHEMATICA
stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
Table[If[n==0, 0, Min[Length/@Split[stc[n]]]], {n, 0, 100}]
CROSSREFS
See link for more sequences related to standard compositions.
The version for Heinz numbers of partitions is A051904, for parts A055396.
For parts instead of run-length we have A333768, maximal A333766.
The opposite (maximal) version is A357137.
For first instead of minimal we have A357180, last A357181.
Sequence in context: A337066 A324247 A138904 * A357180 A196660 A342323
KEYWORD
nonn
AUTHOR
Gus Wiseman, Sep 18 2022
STATUS
approved