OFFSET
3,6
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
EXAMPLE
Triangle begins (dots indicate empty rows):
1: .
2: .
3: 0
4: .
5: -1
6: 1
7: 0 0
8: .
9: -2
10: 0
11: -1 0
12: 2
13: 1 -1
14: 0 1
15: 0 0 0
MATHEMATICA
stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
Table[Differences[stc[n]], {n, 100}]
CROSSREFS
KEYWORD
sign,tabf
AUTHOR
Gus Wiseman, Oct 31 2022
STATUS
approved