OFFSET
0,6
COMMENTS
A sequence is alternating if it is alternately strictly increasing and strictly decreasing, starting with either. For example, the partition (3,3,2,2,2,2,1) has no alternating permutations, even though it has anti-run permutations (2,3,2,3,2,1,2), (2,3,2,1,2,3,2), and (2,1,2,3,2,3,2).
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..500
FORMULA
EXAMPLE
The a(2) = 1 through a(10) = 6 partitions:
11 111 1111 2111 21111 2221 221111 22221 32221
11111 111111 211111 2111111 321111 222211
1111111 11111111 2211111 3211111
21111111 22111111
111111111 211111111
1111111111
MATHEMATICA
normQ[m_]:=m=={}||Union[m]==Range[Max[m]];
wigQ[y_]:=Or[Length[y]==0, Length[Split[y]]==Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
Table[Length[Select[IntegerPartitions[n], normQ[#]&&Select[Permutations[#], wigQ[#]&]=={}&]], {n, 0, 15}]
PROG
(PARI) P(n, m)={Vec(1/prod(k=1, m, 1-y*x^k, 1+O(x*x^n)))}
a(n) = {(n >= 2) + sum(k=2, (sqrtint(8*n+1)-1)\2, my(r=n-binomial(k+1, 2), v=P(r, k)); sum(i=1, min(k, 2*r\k), sum(j=k-1, (2*r-(k-1)*(i-1))\(i+1), my(p=(j+k+(i==1||i==k))\2); if(p*i<=r, polcoef(v[r-p*i+1], j-p)) )))} \\ Andrew Howroyd, Jan 31 2024
CROSSREFS
The complement in covering partitions is counted by A345163.
The separable case is A345166.
A000041 counts integer partitions.
A001250 counts alternating permutations.
A003242 counts anti-run compositions.
A005649 counts anti-run patterns.
A344604 counts alternating compositions with twins.
A344605 counts alternating patterns with twins.
A345164 counts alternating permutations of prime indices.
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jun 12 2021
EXTENSIONS
a(26) onwards from Andrew Howroyd, Jan 31 2024
STATUS
approved