OFFSET
0,3
COMMENTS
Also the number of integer compositions of n whose reverse avoids 12-1 and 23-1.
Theorem: The reverse of a composition avoids 12-1 and 23-1 iff its leaders of maximal weakly increasing runs, obtained by splitting it into maximal weakly increasing subsequences and taking the first term of each, are strictly decreasing. For example, the composition y = (4,5,3,2,2,3,1,3,5) has reverse (5,3,1,3,2,2,3,5,4), which avoids 12-1 and 23-1, while the maximal weakly increasing runs of y are ((4,5),(3),(2,2,3),(1,3,5)), with leaders (4,3,2,1), which are strictly decreasing, as required. - Gus Wiseman, Aug 20 2024
LINKS
John Tyler Rascoe, Table of n, a(n) for n = 0..200
A. M. Baxter, Algorithms for Permutation Statistics, Ph. D. Dissertation, Rutgers University, May 2011.
Andrew M. Baxter and Lara K. Pudwell, Enumeration schemes for dashed patterns, arXiv preprint arXiv:1108.2642 [math.CO], 2011-2012.
Wikipedia, Permutation pattern.
FORMULA
a(n) = 2^(n-1) - A375140(n).
G.f.: 1 + Sum_{i>0} (B(i,x) * Product_{j=1..i-1} (1 + B(j,x))) where B(i,x) = (x^i)/(1-x^i) * Product_{j>i} (1/(1-x^j)). - John Tyler Rascoe, Aug 23 2024
EXAMPLE
From Gus Wiseman, Aug 20 2024: (Start)
The a(0) = 1 through a(6) = 22 compositions:
() (1) (2) (3) (4) (5) (6)
(11) (12) (13) (14) (15)
(21) (22) (23) (24)
(111) (31) (32) (33)
(112) (41) (42)
(211) (113) (51)
(1111) (122) (114)
(212) (123)
(221) (132)
(311) (213)
(1112) (222)
(2111) (312)
(11111) (321)
(411)
(1113)
(1122)
(2112)
(2211)
(3111)
(11112)
(21111)
(111111)
(End)
MATHEMATICA
b[u_, o_] := b[u, o] = Expand[If[u + o == 0, 1, Sum[b[u - j, o + j - 1]*x^(o + j - 1), {j, 1, u}] + Sum[If[u == 0, b[u + j - 1, o - j]*x^(o - j), 0], {j, 1, o}]]];
T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][ b[0, n]];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], Greater@@First/@Split[Reverse[#], LessEqual]&]], {n, 0, 15}] (* Gus Wiseman, Aug 20 2024 *)
- or -
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], !MatchQ[#, {___, y_, z_, ___, x_, ___}/; x<=y<z]&]], {n, 0, 15}] (* Gus Wiseman, Aug 20 2024 *)
PROG
(PARI)
B_x(i, N) = {my(x='x+O('x^N), f=(x^i)/(1-x^i)*prod(j=i+1, N-i, 1/(1-x^j))); f}
A_x(N) = {my(x='x+O('x^N), f=1+sum(i=1, N, B_x(i, N)*prod(j=1, i-1, 1+B_x(j, N)))); Vec(f)}
A_x(60) \\ John Tyler Rascoe, Aug 23 2024
CROSSREFS
For leaders of identical runs we have A000041.
Matching 23-1 only gives A189076.
An opposite version is A358836.
For weakly increasing leaders we have A374635.
For leaders of anti-runs we have A374680.
For leaders of strictly increasing runs we have A374689.
A011782 counts compositions.
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Apr 13 2011
EXTENSIONS
More terms from Andrew Baxter, May 17 2011
a(30)-a(39) from Alois P. Heinz, Nov 14 2015
STATUS
approved