A349051 Numbers k such that the k-th composition in standard order is an alternating permutation of {1..k} for some k.
0, 1, 5, 6, 38, 41, 44, 50, 553, 562, 582, 593, 610, 652, 664, 708, 788, 808, 16966, 17036, 17048, 17172, 17192, 17449, 17458, 17542, 17676, 17712, 17940, 18000, 18513, 18530, 18593, 18626, 18968, 18992, 19496, 19536, 20625, 20676, 20769, 20868, 21256, 22600
Offset: 1
Keywords
Examples
The sequence together with the corresponding compositions begins: 0: () 1: (1) 5: (2,1) 6: (1,2) 38: (3,1,2) 41: (2,3,1) 44: (2,1,3) 50: (1,3,2) 553: (4,2,3,1) 562: (4,1,3,2) 582: (3,4,1,2) 593: (3,2,4,1) 610: (3,1,4,2) 652: (2,4,1,3) 664: (2,3,1,4) 708: (2,1,4,3) 788: (1,4,2,3) 808: (1,3,2,4) 16966: (5,3,4,1,2) 17036: (5,2,4,1,3)
Links
- Wikipedia, Alternating permutation
Crossrefs
Subset of A333218, which ranks permutations of initial intervals.
A003242 counts Carlitz (anti-run) compositions.
A345163 counts normal partitions with an alternating permutation.
A345164 counts alternating permutations of prime indices.
A345170 counts partitions with an alternating permutation.
Compositions in standard order are the rows of A066099:
- Heinz number is given by A333219.
- Runs-resistance is given by A333628.
- Carlitz (anti-run) compositions are ranked by A333489.
Programs
-
Mathematica
stc[n_]:=Differences[Prepend[Join@@Position[ Reverse[IntegerDigits[n,2]],1],0]]//Reverse; wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]== Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1]; Select[Range[0,1000],Sort[stc[#]]==Range[Length[stc[#]]]&&wigQ[stc[#]]&]
Comments