OFFSET
0,3
COMMENTS
One plus the shortest run of 0's after a 1 in the binary expansion of n > 0.
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.
FORMULA
For n > 0, a(n) = A333767(n) + 1.
EXAMPLE
The 148th composition in standard order is (3,2,3), so a(148) = 2.
MATHEMATICA
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
Table[If[n==0, 0, Min@@stc[n]], {n, 0, 100}]
CROSSREFS
Positions of first appearances (ignoring index 0) are A000079.
Positions of terms > 1 are A022340.
The version for prime indices is A055396.
The maximum part is given by A333766.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Compositions without 1's are A022340.
- Sum is A070939.
- Product is A124758.
- Runs are counted by A124767.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Runs-resistance is A333628.
- Weakly decreasing compositions are A114994.
- Weakly increasing compositions are A225620.
- Strictly decreasing compositions are A333255.
- Strictly increasing compositions are A333256.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Apr 06 2020
STATUS
approved