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 has the anti-run permutations (2,3,2,1,2) and (2,1,2,3,2).
LINKS
Joseph Likar, Table of n, a(n) for n = 0..1000
Joseph Likar, Java Implementation using QBinomials
EXAMPLE
The a(2) = 1 through a(9) = 11 partitions:
(11) (111) (22) (2111) (33) (2221) (44) (333)
(1111) (11111) (222) (4111) (2222) (3222)
(3111) (31111) (5111) (6111)
(21111) (211111) (41111) (22221)
(111111) (1111111) (221111) (51111)
(311111) (321111)
(2111111) (411111)
(11111111) (2211111)
(3111111)
(21111111)
(111111111)
MATHEMATICA
wigQ[y_]:=Or[Length[y]==0, Length[Split[y]]== Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
Table[Length[Select[IntegerPartitions[n], Select[Permutations[#], wigQ]=={}&]], {n, 0, 15}]
CROSSREFS
The Heinz numbers of these partitions are A345171.
A000041 counts integer partitions.
A003242 counts anti-run compositions.
A005649 counts anti-run patterns.
A025047 counts alternating or wiggly compositions.
A344604 counts alternating compositions with twins.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jun 12 2021
EXTENSIONS
a(26) onwards by Joseph Likar, Aug 21 2023
STATUS
approved