A230051
Number of permutations of [n] avoiding adjacent step pattern {up}^7.
Original entry on oeis.org
1, 1, 2, 6, 24, 120, 720, 5040, 40319, 362863, 3628550, 39913170, 478947480, 6226179960, 87164597520, 1307440134000, 20918580896069, 355608034188517, 6400803479701178, 121612584595293870, 2432198062707745560, 51075033128533094520, 1123625953230764250960
Offset: 0
a(8) = 40319 = 8!-1: only permutation 12345678 does not avoid {up}^7.
- R. E. L. Aldred, M. D. Atkinson, D. J. McCaughan, Avoiding consecutive patterns in permutations. Adv. in Appl. Math., 45(3), 449-461, 2010.
- Alois P. Heinz, Table of n, a(n) for n = 0..450
- Alin Bostan, Andrew Elvey Price, Anthony John Guttmann, Jean-Marie Maillard, Stieltjes moment sequences for pattern-avoiding permutations, arXiv:2001.00393 [math.CO], 2020.
- Mingjia Yang, Doron Zeilberger, Increasing Consecutive Patterns in Words, arXiv:1805.06077 [math.CO], 2018.
-
b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
`if`(t<6, add(b(u+j-1, o-j, t+1), j=1..o), 0)+
add(b(u-j, o+j-1, 0), j=1..u))
end:
a:= n-> b(n, 0, 0):
seq(a(n), n=0..30);
-
nn=20;r=7;a=Apply[Plus,Table[Normal[Series[y x^(r+1)/(1-Sum[y x^i,{i,1,r}]),{x,0,nn}]][[n]]/(n+r)!,{n,1,nn-r}]]/.y->-1;Range[0,nn]! CoefficientList[Series[1/(1-x-a),{x,0,nn}],x] (* Geoffrey Critzer, Feb 25 2014 *)
CoefficientList[Series[4/(E^(-x) + Cos[x] - Sin[x] + 2*Cos[x/Sqrt[2]] * Cosh[x/Sqrt[2]] - Sqrt[2] * Cos[x/Sqrt[2]] * Sinh[x/Sqrt[2]] - Sqrt[2] * Cosh[x/Sqrt[2]] * Sin[x/Sqrt[2]]),{x,0,20}],x] * Range[0,20]! (* Vaclav Kotesovec, Aug 23 2014 *)
A177553
Number of permutations of 1..n avoiding adjacent step pattern up, up, up, up, up, up.
Original entry on oeis.org
1, 1, 2, 6, 24, 120, 720, 5039, 40305, 362682, 3626190, 39881160, 478490760, 6219298800, 87055051511, 1305598835941, 20885951018102, 354999461960226, 6388879812001704, 121367620532150280, 2426930566055020080, 50956684690331669759, 1120852238721212726609
Offset: 0
- Alois P. Heinz, Table of n, a(n) for n = 0..450
- Mingjia Yang, Doron Zeilberger, Increasing Consecutive Patterns in Words, arXiv:1805.06077 [math.CO], 2018.
- Mingjia Yang, An experimental walk in patterns, partitions, and words, Ph. D. Dissertation, Rutgers University (2020).
-
b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
`if`(t<5, add(b(u+j-1, o-j, t+1), j=1..o), 0)+
add(b(u-j, o+j-1, 0), j=1..u))
end:
a:= n-> b(n, 0, 0):
seq(a(n), n=0..30); # Alois P. Heinz, Oct 07 2013
-
nn=20;r=6;a=Apply[Plus,Table[Normal[Series[y x^(r+1)/(1-Sum[y x^i,{i,1,r}]),{x,0,nn}]][[n]]/(n+r)!,{n,1,nn-r}]]/.y->-1;Range[0,nn]! CoefficientList[Series[1/(1-x-a),{x,0,nn}],x] (* Geoffrey Critzer, Feb 25 2014 *)
Table[n!*SeriesCoefficient[1/(Sum[x^(7*k)/(7*k)!-x^(7*k+1)/(7*k+1)!,{k,0,n}]),{x,0,n}],{n,1,20}] (* Vaclav Kotesovec, Aug 29 2014 *)
A230231
Number of permutations of [n] avoiding adjacent step pattern {up}^8.
Original entry on oeis.org
1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362879, 3628781, 39916492, 478996716, 6226941864, 87176969880, 1307651304960, 20922368987520, 355679390626560, 6402213152423659, 121641748198554547, 2432828930036156696, 51089280818439941448, 1123961390341566969192
Offset: 0
-
b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
`if`(t<7, add(b(u+j-1, o-j, t+1), j=1..o), 0)+
add(b(u-j, o+j-1, 0), j=1..u))
end:
a:= n-> b(n, 0, 0):
seq(a(n), n=0..30);
-
nn=20;r=8;a=Apply[Plus,Table[Normal[Series[y x^(r+1)/(1-Sum[y x^i,{i,1,r}]),{x,0,nn}]][[n]]/(n+r)!,{n,1,nn-r}]]/.y->-1;Range[0,nn]! CoefficientList[Series[1/(1-x-a),{x,0,nn}],x] (* Geoffrey Critzer, Feb 25 2014 *)
CoefficientList[Series[1/(HypergeometricPFQ[{}, {1/9, 2/9, 1/3, 4/9, 5/9, 2/3, 7/9, 8/9}, x^9/387420489] - x*HypergeometricPFQ[{}, {2/9, 1/3, 4/9, 5/9, 2/3, 7/9, 8/9, 10/9}, x^9/387420489]), {x, 0, 20}], x]* Range[0, 20]! (* Vaclav Kotesovec, Feb 01 2015 *)
A230232
Number of permutations of [n] avoiding adjacent step pattern {up}^9.
Original entry on oeis.org
1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628799, 39916779, 479001228, 6227014404, 87178179816, 1307672369640, 20922752672640, 355686706327680, 6402359109968640, 121644792614741760, 2432895242801771955, 51090787299486057355, 1123997039003038423610
Offset: 0
-
b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
`if`(t<8, add(b(u+j-1, o-j, t+1), j=1..o), 0)+
add(b(u-j, o+j-1, 0), j=1..u))
end:
a:= n-> b(n, 0, 0):
seq(a(n), n=0..30);
-
nn=20;r=9;a=Apply[Plus,Table[Normal[Series[y x^(r+1)/(1-Sum[y x^i,{i,1,r}]),{x,0,nn}]][[n]]/(n+r)!,{n,1,nn-r}]]/.y->-1;Range[0,nn]! CoefficientList[Series[1/(1-x-a),{x,0,nn}],x] (* Geoffrey Critzer, Feb 25 2014 *)
FullSimplify[CoefficientList[Series[10/(2/E^x - Sqrt[2*(5 - Sqrt[5])]* Cosh[(1/4)*(1 + Sqrt[5])*x]* Sin[Sqrt[(1/8)*(5 - Sqrt[5])]*x] - Sqrt[2*(5 + Sqrt[5])]*Cosh[(1/4)*(Sqrt[5] - 1)* x]*Sin[Sqrt[(1/8)*(5 + Sqrt[5])]*x] + Cos[Sqrt[(1/8)*(5 + Sqrt[5])]*x]* (4*Cosh[(1/4)*(Sqrt[5] - 1)*x] - (Sqrt[5] - 1)*Sinh[(1/4)*(Sqrt[5] - 1)*x]) - Cos[Sqrt[(1/8)*(5 - Sqrt[5])]*x]* ((1 + Sqrt[5])*Sinh[(1/4)*(1 + Sqrt[5])*x] - 4*Cosh[(1/4)*(1 + Sqrt[5])*x])), {x, 0, 20}], x] * Range[0, 20]!] (* Vaclav Kotesovec, Jan 31 2015 *)
A230233
Number of permutations of [n] avoiding adjacent step pattern {up}^10.
Original entry on oeis.org
1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916799, 479001577, 6227020358, 87178283010, 1307674215120, 20922786961440, 355687370176320, 6402372516146880, 121645075013280000, 2432901444395385600, 51090929159028595200, 1124000415686590747031
Offset: 0
-
b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
`if`(t<9, add(b(u+j-1, o-j, t+1), j=1..o), 0)+
add(b(u-j, o+j-1, 0), j=1..u))
end:
a:= n-> b(n, 0, 0):
seq(a(n), n=0..30);
-
nn=20;r=10;a=Apply[Plus,Table[Normal[Series[y x^(r+1)/(1-Sum[y x^i,{i,1,r}]),{x,0,nn}]][[n]]/(n+r)!,{n,1,nn-r}]]/.y->-1;Range[0,nn]! CoefficientList[Series[1/(1-x-a),{x,0,nn}],x] (* Geoffrey Critzer, Feb 25 2014 *)
CoefficientList[Series[1/(HypergeometricPFQ[{}, {1/11, 2/11, 3/11, 4/11, 5/11, 6/11, 7/11, 8/11, 9/11, 10/11}, x^11/285311670611] - x*HypergeometricPFQ[{}, {2/11, 3/11, 4/11, 5/11, 6/11, 7/11, 8/11, 9/11, 10/11, 12/11}, x^11/285311670611]), {x, 0, 25}], x] * Range[0, 25]! (* Vaclav Kotesovec, Jan 17 2015 *)
A230797
Number T(n,k) of permutations of [n] with exactly k (possibly overlapping) occurrences of the consecutive step pattern up, down, up, down; triangle T(n,k), n>=0, 0<=k<=max(0,floor((n-3)/2)), read by rows.
Original entry on oeis.org
1, 1, 2, 6, 24, 104, 16, 528, 192, 3296, 1472, 272, 23168, 12800, 4352, 179712, 132352, 42880, 7936, 1573632, 1366016, 530432, 158720, 15207424, 14781952, 7662336, 1911296, 353792, 158880768, 178102272, 101713920, 31813632, 8491008, 1801996288, 2282645504
Offset: 0
T(5,1) = 16: 13254, 14253, 14352, 15243, 15342, 23154, 24153, 24351, 25143, 25341, 34152, 34251, 35142, 35241, 45132, 45231.
T(7,2) = 272: 1325476, 1326475, 1326574, ..., 6735241, 6745132, 6745231.
Triangle T(n,k) begins:
: 0 : 1;
: 1 : 1;
: 2 : 2;
: 3 : 6;
: 4 : 24;
: 5 : 104, 16;
: 6 : 528, 192;
: 7 : 3296, 1472, 272;
: 8 : 23168, 12800, 4352;
: 9 : 179712, 132352, 42880, 7936;
: 10 : 1573632, 1366016, 530432, 158720;
T(2n-1,n-2) gives
A000182(n) for n>=3.
-
b:= proc(u, o, t) option remember; `if`(u+o=0, 1, expand(
add(b(u-j, o+j-1, [1, 3, 1, 3][t])*`if`(t=4, x, 1), j=1..u)+
add(b(u+j-1, o-j, [2, 2, 4, 2][t]), j=1..o)))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0, 1)):
seq(T(n), n=0..15); # Alois P. Heinz, Oct 30 2013
-
b[u_, o_, t_] := b[u, o, t] = If[u+o == 0, 1, Expand[Sum[b[u-j, o+j-1, {1, 3, 1, 3}[[t]]]*If[t == 4, x, 1], {j, 1, u}] + Sum[b[u+j-1, o-j, {2, 2, 4, 2}[[t]]], {j, 1, o}]]]; T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n, 0, 1]]; Table[T[n], {n, 0, 15}] // Flatten (* Jean-François Alcover, Oct 24 2016, after Alois P. Heinz *)
A227884
Number T(n,k) of permutations of [n] with exactly k (possibly overlapping) occurrences of the consecutive step pattern up, down, up; triangle T(n,k), n>=0, 0<=k<=max(0,floor(n/2)-1), read by rows.
Original entry on oeis.org
1, 1, 2, 6, 19, 5, 70, 50, 331, 328, 61, 1863, 2154, 1023, 11637, 16751, 10547, 1385, 81110, 144840, 102030, 34900, 635550, 1314149, 1109973, 518607, 50521, 5495339, 12735722, 13046040, 6858598, 1781101, 51590494, 134159743, 157195762, 97348436, 36004400
Offset: 0
T(4,1) = 5: 1324, 1423, 2314, 2413, 3412.
Triangle T(n,k) begins:
: 0 : 1;
: 1 : 1;
: 2 : 2;
: 3 : 6;
: 4 : 19, 5;
: 5 : 70, 50;
: 6 : 331, 328, 61;
: 7 : 1863, 2154, 1023;
: 8 : 11637, 16751, 10547, 1385;
: 9 : 81110, 144840, 102030, 34900;
: 10 : 635550, 1314149, 1109973, 518607, 50521;
T(2n,n-1) gives
A000364(n) for n>=2.
-
b:= proc(u, o, t) option remember; `if`(u+o=0, 1, expand(
add(b(u-j, o+j-1, [1, 3, 1][t]), j=1..u)+
add(b(u+j-1, o-j, 2)*`if`(t=3, x, 1), j=1..o)))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0, 1)):
seq(T(n), n=0..15);
-
b[u_, o_, t_] := b[u, o, t] = If[u+o==0, 1, Expand[Sum[b[u-j, o+j-1, {1, 3, 1}[[t]]], {j, 1, u}]+Sum[b[u+j-1, o-j, 2]*If[t==3, x, 1], {j, 1, o}]]];
T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][ b[n, 0, 1]];
Table[T[n], {n, 0, 15}] // Flatten (* Jean-François Alcover, Mar 29 2017, translated from Maple *)
A335308
Number of permutations p of [n] such that the sequence of ascents and descents of p is encoded by the 0's and 1's, respectively, in the binary expansion of n (read from right to left and using leading 0's if necessary).
Original entry on oeis.org
1, 0, 0, 1, 3, 16, 26, 20, 69, 370, 1006, 945, 1266, 3015, 2365, 1001, 4367, 24736, 76960, 69615, 138397, 322944, 286824, 133056, 159391, 546504, 978054, 674245, 531530, 957320, 495495, 142506, 906191, 5537808, 18828096, 16231039, 37000909, 81351936, 71761536
Offset: 0
a(0) = 1: (), the empty permutation.
a(3) = 1: 321 (down, down).
a(4) = 3: 1243, 1342, 2341 (up, up, down).
a(5) = 16: 21435, 21534, 31425, 31524, 32415, 32514, 41325, 41523, 42315, 42513, 43512, 51324, 51423, 52314, 52413, 53412 (down, up, down, up).
a(6) = 26: 143256, 153246, 154236, 163245, 164235, 165234, 243156, 253146, 254136, 263145, 264135, 265134, 342156, 352146, 354126, 362145, 364125, 365124, 452136, 453126, 462135, 463125, 465123, 562134, 563124, 564123 (up, down, down, up, up).
a(7) = 20: 4321567, 5321467, 5421367, 5431267, 6321457, 6421357, 6431257, 6521347, 6531247, 6541237, 7321456, 7421356, 7431256, 7521346, 7531246, 7541236, 7621345, 7631245, 7641235, 7651234 (down^3, up^3).
-
b:= proc(u, o, t) option remember; `if`(u+o=0, `if`(t=0, 1, 0),
`if`(irem(t, 2)=0, add(b(u-j, o+j-1, iquo(t, 2)), j=1..u),
add(b(u+j-1, o-j, iquo(t, 2)), j=1..o)))
end:
a:= n-> b(n, 0, 2*n):
seq(a(n), n=0..42);
A230695
Number T(n,k) of permutations of [n] with exactly k (possibly overlapping) occurrences of the consecutive step pattern up, down, down, up; triangle T(n,k), n>=0, 0<=k<=max(0,floor((n-2)/3)), read by rows.
Original entry on oeis.org
1, 1, 2, 6, 24, 109, 11, 588, 132, 3654, 1386, 26125, 13606, 589, 209863, 139714, 13303, 1876502, 1508756, 243542, 18441367, 17429745, 3953529, 92159, 197776850, 214536114, 63334182, 3354454, 2297242583, 2815529811, 1020982869, 93265537, 28739304385
Offset: 0
T(5,1) = 11: 14325, 15324, 15423, 24315, 25314, 25413, 34215, 35214, 35412, 45213, 45312.
T(8,2) = 589: 14327658, 14328657, 14328756, ..., 78635412, 78645213, 78645312.
Triangle T(n,k) begins:
: 0 : 1;
: 1 : 1;
: 2 : 2;
: 3 : 6;
: 4 : 24;
: 5 : 109, 11;
: 6 : 588, 132;
: 7 : 3654, 1386;
: 8 : 26125, 13606, 589;
: 9 : 209863, 139714, 13303;
: 10 : 1876502, 1508756, 243542;
: 11 : 18441367, 17429745, 3953529, 92159;
-
b:= proc(u, o, t) option remember; `if`(u+o=0, 1, expand(
add(b(u-j, o+j-1, [1, 3, 4, 1][t]), j=1..u)+
add(b(u+j-1, o-j, 2)*`if`(t=4, x, 1), j=1..o)))
end:
T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0, 1)):
seq(T(n), n=0..15);
-
b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, 1, Expand[
Sum[b[u - j, o + j - 1, {1, 3, 4, 1}[[t]]], {j, 1, u}] +
Sum[b[u + j - 1, o - j, 2]*If[t == 4, x, 1], {j, 1, o}]]];
T[n_] := CoefficientList[b[n, 0, 1], x];
T /@ Range[0, 15] // Flatten (* Jean-François Alcover, Mar 22 2021, after Alois P. Heinz *)
A242785
Number of permutations of [n] avoiding the consecutive step pattern given by the binary expansion of n, where 1=up and 0=down.
Original entry on oeis.org
1, 1, 2, 5, 21, 70, 450, 4326, 34944, 209863, 1573632, 21824925, 302273664, 2854894485, 60269056512, 1207441809209, 19346879737625, 252773481889854, 2918333808555034, 69792946997645295, 982945842995115000, 16085109561896603059, 402131210857811703926
Offset: 0
a(4) = 21 because there are 4! = 24 permutations of {1,2,3,4} and only 3 of them do not avoid the consecutive step pattern up, down, down given by the binary expansion of 4 = 100_2: (1,4,3,2), (2,4,3,1), (3,4,2,1).
-
a:= proc(n) option remember; local b, m, r, h;
if n<2 then return 1 fi;
m:= iquo(n, 2, 'r'); h:= 2^ilog2(n);
b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
`if`(t=m and r=0, 0, add(b(u-j, o+j-1, irem(2*t, h)), j=1..u))+
`if`(t=m and r=1, 0, add(b(u+j-1, o-j, irem(2*t+1, h)), j=1..o)))
end; forget(b);
b(n, 0, 0)
end:
seq(a(n), n=0..30);
-
a[n_] := a[n] = Module[{b, m, r, h},
If[n < 2, Return[1]]; {m, r} = QuotientRemainder[n, 2];
h = 2^(Length@IntegerDigits[n, 2] - 1);
b[u_, o_, t_] := b[u, o, t] = If[u + o == 0, 1,
If[t == m && r == 0, 0,
Sum[b[u - j, o + j - 1, Mod[2t, h]], {j, 1, u}]] +
If[t == m && r == 1, 0,
Sum[b[u + j - 1, o - j, Mod[2t+1, h]], {j, 1, o}]]];
b[n, 0, 0]];
a /@ Range[0, 30] (* Jean-François Alcover, Mar 23 2021, after Alois P. Heinz *)