OFFSET
0,5
COMMENTS
A sequence is alternating if it is alternately strictly increasing and strictly decreasing, starting with either. For example, the partition (3,2,2,2,1) has no alternating permutations, even though it does have the anti-run permutations (2,3,2,1,2) and (2,1,2,3,2).
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..1000
EXAMPLE
The a(2) = 1 through a(6) = 20 compositions:
(11) (111) (22) (113) (33)
(112) (122) (114)
(211) (221) (123)
(1111) (311) (222)
(1112) (321)
(1121) (411)
(1211) (1113)
(2111) (1122)
(11111) (1131)
(1221)
(1311)
(2112)
(2211)
(3111)
(11112)
(11121)
(11211)
(12111)
(21111)
(111111)
MATHEMATICA
wigQ[y_]:=Or[Length[y]==0, Length[Split[y]]== Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], !wigQ[#]&]], {n, 0, 15}]
CROSSREFS
The case without twins is A348377.
The version for factorizations is A348613.
A003242 counts anti-run compositions.
A011782 counts compositions.
A032020 counts strict compositions.
A106356 counts compositions by number of maximal anti-runs.
A114901 counts compositions where each part is adjacent to an equal part.
A274174 counts compositions with equal parts contiguous.
A344604 counts alternating compositions with twins.
A344605 counts alternating patterns with twins.
A344654 counts non-twin partitions with no alternating permutation.
A345162 counts normal partitions with no alternating permutation.
A345164 counts alternating permutations of prime indices.
Patterns:
- A128761 avoiding (1,2,3) adjacent.
- A344614 avoiding (1,2,3) and (3,2,1) adjacent.
- A344615 weakly avoiding (1,2,3) adjacent.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jun 17 2021
STATUS
approved