login
A345195
Number of non-alternating anti-run compositions of n.
18
0, 0, 0, 0, 0, 0, 2, 4, 10, 23, 49, 96, 192, 368, 692, 1299, 2403, 4400, 8029, 14556, 26253, 47206, 84574, 151066, 269244, 478826, 849921, 1506309, 2665829, 4711971, 8319763, 14675786, 25865400, 45552678, 80171353, 141015313, 247905305, 435614270, 765132824
OFFSET
0,7
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).
An anti-run (separation or Carlitz composition) is a sequence with no adjacent equal parts.
LINKS
FORMULA
a(n) = A003242(n) - A025047(n).
EXAMPLE
The a(9) = 23 anti-runs:
(1,2,6) (1,2,4,2) (1,2,1,2,3)
(1,3,5) (1,2,5,1) (1,2,3,1,2)
(2,3,4) (1,3,4,1) (1,2,3,2,1)
(4,3,2) (1,4,3,1) (1,3,2,1,2)
(5,3,1) (1,5,2,1) (2,1,2,3,1)
(6,2,1) (2,1,2,4) (2,1,3,2,1)
(2,4,2,1) (3,2,1,2,1)
(3,1,2,3)
(3,2,1,3)
(4,2,1,2)
MATHEMATICA
wigQ[y_]:=Or[Length[y]==0, Length[Split[y]]== Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
sepQ[y_]:=!MatchQ[y, {___, x_, x_, ___}];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], sepQ[#]&&!wigQ[#]&]], {n, 0, 15}]
CROSSREFS
Non-anti-run compositions are counted by A261983.
A version counting partitions is A345166, ranked by A345173.
These compositions are ranked by A345169.
Non-alternating compositions are counted by A345192, ranked by A345168.
A001250 counts alternating permutations, complement A348615.
A003242 counts anti-run compositions, ranked by A333489.
A011782 counts compositions.
A025047 counts alternating or wiggly compositions, ranked by A345167.
A032020 counts strict compositions.
A106356 counts compositions by number of maximal anti-runs.
A325534 counts separable partitions, ranked by A335433.
A325535 counts inseparable partitions, ranked by A335448.
A345164 counts alternating permutations of prime indices, w/ twins A344606.
A345165 counts partitions w/o an alternating permutation, ranked by A345171.
A345170 counts partitions w/ an alternating permutation, ranked by A345172.
A345194 counts alternating patterns (with twins: A344605).
Sequence in context: A294680 A189890 A189587 * A018111 A189594 A094987
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jun 17 2021
EXTENSIONS
a(21) onwards from Andrew Howroyd, Jan 31 2024
STATUS
approved