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 (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.
LINKS
Claude Lenormand, Deux transformations sur les mots, Preprint, 5 pages, Nov 17 2003.
EXAMPLE
The standard compositions and their run-lengths:
0 ~ () -> () ~ 0
1 ~ (1) -> (1) ~ 1
2 ~ (2) -> (1) ~ 1
3 ~ (11) -> (2) ~ 2
4 ~ (3) -> (1) ~ 1
5 ~ (21) -> (11) ~ 3
6 ~ (12) -> (11) ~ 3
7 ~ (111) -> (3) ~ 4
8 ~ (4) -> (1) ~ 1
9 ~ (31) -> (11) ~ 3
10 ~ (22) -> (2) ~ 2
11 ~ (211) -> (12) ~ 6
12 ~ (13) -> (11) ~ 3
13 ~ (121) -> (111) ~ 7
14 ~ (112) -> (21) ~ 5
15 ~ (1111) -> (4) ~ 8
16 ~ (5) -> (1) ~ 1
17 ~ (41) -> (11) ~ 3
18 ~ (32) -> (11) ~ 3
19 ~ (311) -> (12) ~ 6
MATHEMATICA
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
Table[Total[2^(Accumulate[Reverse[Length/@Split[stc[n]]]])]/2, {n, 0, 30}]
CROSSREFS
Positions of first appearances are A333630.
All of the following pertain to compositions in standard order (A066099):
- The length is A000120.
- The partial sums from the right are A048793.
- The sum is A070939.
- Adjacent equal pairs are counted by A124762.
- Equal runs are counted by A124767.
- Strict compositions are ranked by A233564.
- The partial sums from the left are A272020.
- Constant compositions are ranked by A272919.
- Normal compositions are ranked by A333217.
- Heinz number is A333219.
- Anti-runs are counted by A333381.
- Adjacent unequal pairs are counted by A333382.
- Runs-resistance is A333628.
- First appearances of run-resistances are A333629.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Mar 30 2020
STATUS
approved