OFFSET
1,2
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.
EXAMPLE
The terms together with their binary expansions and standard compositions begin:
0: 0 ()
3: 11 (1,1)
10: 1010 (2,2)
36: 100100 (3,3)
43: 101011 (2,2,1,1)
58: 111010 (1,1,2,2)
136: 10001000 (4,4)
147: 10010011 (3,3,1,1)
228: 11100100 (1,1,3,3)
528: 1000010000 (5,5)
547: 1000100011 (4,4,1,1)
586: 1001001010 (3,3,2,2)
676: 1010100100 (2,2,3,3)
904: 1110001000 (1,1,4,4)
MATHEMATICA
stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
Select[Range[0, 1000], UnsameQ@@Split[stc[#]]&&And@@(#==2&)/@Length/@Split[stc[#]]&]
CROSSREFS
The case of twins (binary weight 2) is A000120.
All terms are evil numbers A001969.
These compositions are counted by A032020 interspersed with 0's.
Taking singles instead of twins gives A349051.
A011782 counts compositions.
A085207 represents concatenation using standard compositions.
Cf. A003242, A027383, A035363, A088218, A106356, A122134, A238279, A344604, A349054, A351005, A351007.
Selected statistics of standard compositions:
- Length is A000120.
- Sum is A070939.
- Heinz number is A333219.
- Number of distinct parts is A334028.
Selected classes of standard compositions:
- Strict compositions are A233564.
- Constant compositions are A272919.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Feb 03 2022
STATUS
approved