OFFSET
1,3
COMMENTS
These are compositions avoiding the patterns (1,2,1) and (2,1,2).
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 together with their standard compositions begin:
0: ()
1: (1)
2: (2)
3: (1,1)
4: (3)
5: (2,1)
6: (1,2)
7: (1,1,1)
8: (4)
9: (3,1)
10: (2,2)
11: (2,1,1)
12: (1,3)
14: (1,1,2)
15: (1,1,1,1)
16: (5)
See A374253 for the complement: 13, 22, 25, 27, 29, ...
MATHEMATICA
stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
Select[Range[0, 100], UnsameQ@@First/@Split[stc[#]]&]
CROSSREFS
Compositions of this type are counted by A274174.
Permutations of prime indices of this type are counted by A333175.
A011782 counts compositions.
A066099 lists compositions in standard order.
A333755 counts compositions by number of runs.
A335454 counts patterns matched by standard compositions.
A335462 counts (1,2,1)- and (2,1,2)-matching permutations of prime indices.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jul 13 2024
STATUS
approved