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.
LINKS
EXAMPLE
The terms, binary expansions, and standard compositions:
1: 1 (1)
3: 11 (1,1)
5: 101 (2,1)
6: 110 (1,2)
7: 111 (1,1,1)
9: 1001 (3,1)
11: 1011 (2,1,1)
12: 1100 (1,3)
13: 1101 (1,2,1)
14: 1110 (1,1,2)
15: 1111 (1,1,1,1)
17: 10001 (4,1)
19: 10011 (3,1,1)
21: 10101 (2,2,1)
22: 10110 (2,1,2)
23: 10111 (2,1,1,1)
24: 11000 (1,4)
25: 11001 (1,3,1)
26: 11010 (1,2,2)
27: 11011 (1,2,1,1)
28: 11100 (1,1,3)
29: 11101 (1,1,2,1)
30: 11110 (1,1,1,2)
31: 11111 (1,1,1,1,1)
MATHEMATICA
Select[Range[0, 100], OddQ[#]||MatchQ[IntegerDigits[#, 2], {___, 1, 1, ___}]&]
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Sep 02 2022
STATUS
approved