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 corresponding compositions begin:
0: ()
5: (2,1)
6: (1,2)
17: (4,1)
18: (3,2)
20: (2,3)
24: (1,4)
43: (2,2,1,1)
45: (2,1,2,1)
46: (2,1,1,2)
53: (1,2,2,1)
54: (1,2,1,2)
58: (1,1,2,2)
65: (6,1)
66: (5,2)
68: (4,3)
72: (3,4)
80: (2,5)
96: (1,6)
MATHEMATICA
stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
Select[Range[0, 100], Count[stc[#], _?EvenQ]==Count[stc[#], _?OddQ]&]
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jun 28 2022
STATUS
approved