login
A358135
Difference of first and last parts of the n-th composition in standard order.
8
0, 0, 0, 0, -1, 1, 0, 0, -2, 0, -1, 2, 0, 1, 0, 0, -3, -1, -2, 1, -1, 0, -1, 3, 0, 1, 0, 2, 0, 1, 0, 0, -4, -2, -3, 0, -2, -1, -2, 2, -1, 0, -1, 1, -1, 0, -1, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 0, -5, -3, -4, -1, -3, -2, -3, 1, -2, -1, -2, 0, -2
OFFSET
1,9
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.
FORMULA
a(n) = A001511(n) - A065120(n).
MATHEMATICA
stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
Table[-First[stc[n]]+Last[stc[n]], {n, 1, 100}]
CROSSREFS
See link for sequences related to standard compositions.
The first and last parts are A065120 and A001511.
This is the first minus last part of row n of A066099.
The version for Heinz numbers of partitions is A243055.
Row sums of A358133.
The partial sums of standard compositions are A358134, adjusted A242628.
A011782 counts compositions.
A333766 and A333768 give max and min in standard compositions, diff A358138.
A351014 counts distinct runs in standard compositions.
Sequence in context: A238160 A178524 A321731 * A212357 A114525 A127672
KEYWORD
sign
AUTHOR
Gus Wiseman, Oct 31 2022
STATUS
approved