cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Previous Showing 11-20 of 56 results. Next

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

Views

Author

Alois P. Heinz, Oct 07 2013

Keywords

Examples

			a(8) = 40319 = 8!-1: only permutation 12345678 does not avoid {up}^7.
		

References

  • R. E. L. Aldred, M. D. Atkinson, D. J. McCaughan, Avoiding consecutive patterns in permutations. Adv. in Appl. Math., 45(3), 449-461, 2010.

Crossrefs

Column k=127 of A242784.

Programs

  • Maple
    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);
  • Mathematica
    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 *)

Formula

E.g.f.: 1 / Sum_{n>=0} (8*n+1-x)*x^(8*n)/(8*n+1)!.
E.g.f. (Aldred, Atkinson, McCaughan, 2010): 4/(exp(-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))). - Vaclav Kotesovec, Aug 23 2014
a(n)/n! ~ c / r^n, where r = 1.0000220496837836995332841475679738951237308817759821845322... is the root of the equation exp(-r) + cos(r) - sin(r) + 2*cos(r/sqrt(2)) * cosh(r/sqrt(2)) - sqrt(2)*cos(r/sqrt(2)) * sinh(r/sqrt(2)) - sqrt(2) * cosh(r/sqrt(2)) * sin(r/sqrt(2)) = 0, c = 2*sqrt(2) / (r*sqrt(2 + cosh(sqrt(2)*r) - cos(2*r) + 2*cosh(r/sqrt(2)) * (2*sqrt(2)*sin(r) * sin(r/sqrt(2)) - cos(sqrt(2)*r) * cosh(r/sqrt(2))))) = 1.0001516144914746839400607922657094772985420791612537... . - Vaclav Kotesovec, Aug 23 2014, updated Feb 01 2015

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

Views

Author

R. H. Hardin, May 10 2010

Keywords

Crossrefs

Column k=63 of A242784.

Programs

  • Maple
    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
  • Mathematica
    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 *)

Formula

a(n)/n! ~ c * (1/r)^n, where r = 1.0001738181531504504518260962714687775785823593018886... is the root of the equation Sum_{n>=0} (r^(7*n)/(7*n)! - r^(7*n+1)/(7*n+1)!) = 0, c = 1.0010191104259450282450770594076722424772755532278.... - Vaclav Kotesovec, Aug 29 2014
E.g.f.: -(7/(2*((-cos(x*cos(3*Pi/14)))*cosh(x*sin(3*Pi/14)) + cos(x*cos(3*Pi/14))*cosh(x*sin(3*Pi/14))* sin(3*Pi/14) - cosh(x*sin(Pi/14))* (cos(x*cos(Pi/14))*(1 + sin(Pi/14)) - cos(Pi/14)*sin(x*cos(Pi/14))) + cos(3*Pi/14)*cosh(x*sin(3*Pi/14))* sin(x*cos(3*Pi/14)) - cosh(x*cos(Pi/7))* ((1 + cos(Pi/7))*cos(x*sin(Pi/7)) - sin(Pi/7)*sin(x*sin(Pi/7))) + cos(x*sin(Pi/7))* sinh(x*cos(Pi/7)) + cos(Pi/7)*cos(x*sin(Pi/7))* sinh(x*cos(Pi/7)) - sin(Pi/7)*sin(x*sin(Pi/7))* sinh(x*cos(Pi/7)) + cos(x*cos(Pi/14))* sinh(x*sin(Pi/14)) + cos(x*cos(Pi/14))*sin(Pi/14)* sinh(x*sin(Pi/14)) - cos(Pi/14)*sin(x*cos(Pi/14))* sinh(x*sin(Pi/14)) - cos(x*cos(3*Pi/14))* sinh(x*sin(3*Pi/14)) + cos(x*cos(3*Pi/14))* sin(3*Pi/14)*sinh(x*sin(3*Pi/14)) + cos(3*Pi/14)*sin(x*cos(3*Pi/14))* sinh(x*sin(3*Pi/14))))). - Vaclav Kotesovec, Jan 31 2015
In closed form, c = 7 / (r * (2*cos(r*sin(Pi/7))*cosh(r*cos(Pi/7)) + cos(Pi/7 - r*sin(Pi/7)) * cosh(r*cos(Pi/7)) + cos(Pi/7 - r*sin(Pi/7)) * cosh(r*cos(Pi/7)) + 2*cos(r*cos(Pi/14)) * cosh(r*sin(Pi/14)) + 2*cos(r*cos(3*Pi/14)) * cosh(r*sin(3*Pi/14)) + 2*cosh(r*sin(Pi/14)) * sin(Pi/14 + r*cos(Pi/14)) - 2*cosh(r*sin(3*Pi/14)) * sin(3*Pi/14 - r*cos(3*Pi/14)) - 2*cos(r*sin(Pi/7)) * sinh(r*cos(Pi/7)) - cos(Pi/7 - r*sin(Pi/7)) * sinh(r*cos(Pi/7)) - cos(Pi/7 - r*sin(Pi/7)) * sinh(r*cos(Pi/7)) - 2*cos(r*cos(Pi/14)) * sinh(r*sin(Pi/14)) - 2*sin(Pi/14 + r*cos(Pi/14))*sinh(r*sin(Pi/14)) + 2*cos(r*cos(3*Pi/14)) * sinh(r*sin(3*Pi/14)) - 2*sin((3*Pi)/14 - r*cos(3*Pi/14)) * sinh(r*sin(3*Pi/14)))). - Vaclav Kotesovec, Feb 01 2015

Extensions

a(18)-a(22) from Alois P. Heinz, Oct 07 2013
a(0)=1 prepended by Alois P. Heinz, Aug 08 2018

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

Views

Author

Alois P. Heinz, Oct 12 2013

Keywords

Crossrefs

Programs

  • Maple
    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);
  • Mathematica
    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 *)

Formula

E.g.f.: 1 / Sum_{n>=0} (9*n+1-x)*x^(9*n)/(9*n+1)!.
a(n)/n! ~ 1.0000195665100891649606434859189953881417919885320660432331680939719... * (1/r)^n, where r = 1.0000024802134092668222044475851121972165291678378389183730077680957571... is the root of the equation Sum_{n>=0} (r^(9*n)/(9*n)! - r^(9*n+1)/(9*n+1)!) = 0. - Vaclav Kotesovec, Jan 17 2015
E.g.f.: 1/(1/3 * cos((sqrt(3)*x)/2) * cosh(x/2) + 2/9 * cos(x * sin(Pi/9)) * cosh(x * cos(Pi/9)) + 2/9 * cos(Pi/9) * cos(x * sin(Pi/9)) * cosh(x * cos(Pi/9)) + 2/9 * cos(x * cos(Pi/18)) * cosh(x * sin(Pi/18)) + 2/9 * cos(x/2*(sqrt(3) * cos(Pi/9) - sin(Pi/9)))* cosh(x/2*(cos(Pi/9) + sqrt(3) * sin(Pi/9))) - 1/9 * cos(Pi/9) * cos(x/2*(sqrt(3) * cos(Pi/9) - sin(Pi/9))) * cosh(x/2*(cos(Pi/9) + sqrt(3) * sin(Pi/9))) - 2/9 * cos(x * cos(Pi/18))* cosh(x * sin(Pi/18)) * sin(Pi/18) - (cos(x/2*(sqrt(3) * cos(Pi/9) - sin(Pi/9)))* cosh(x/2*(cos(Pi/9) + sqrt(3) * sin(Pi/9)))* sin(Pi/9))/(3 * sqrt(3)) - (cosh(x/2) * sin((sqrt(3)*x)/2))/(3 * sqrt(3)) - 2/9 * cos(Pi/18) * cosh(x * sin(Pi/18)) * sin(x * cos(Pi/18)) - (cos(Pi/9) * cosh(x/2*(cos(Pi/9) + sqrt(3) * sin(Pi/9)))* sin(x/2*(sqrt(3) * cos(Pi/9) - sin(Pi/9))))/ (3 * sqrt(3)) + 1/9 * cosh(x/2*(cos(Pi/9) + sqrt(3) * sin(Pi/9)))* sin(Pi/9) * sin(x/2*(sqrt(3) * cos(Pi/9) - sin(Pi/9))) - 2/9 * cosh(x * cos(Pi/9)) * sin(Pi/9)* sin(x * sin(Pi/9)) - 1/3 * cos((sqrt(3)*x)/2)* sinh(x/2) + (sin((sqrt(3)*x)/2) * sinh(x/2))/ (3 * sqrt(3)) - 2/9 * cos(x * sin(Pi/9))* sinh(x * cos(Pi/9)) - 2/9 * cos(Pi/9) * cos(x * sin(Pi/9))* sinh(x * cos(Pi/9)) + 2/9 * sin(Pi/9) * sin(x * sin(Pi/9))* sinh(x * cos(Pi/9)) + 2/9 * cos(x * cos(Pi/18))* sinh(x * sin(Pi/18)) - 2/9 * cos(x * cos(Pi/18))* sin(Pi/18) * sinh(x * sin(Pi/18)) - 2/9 * cos(Pi/18)* sin(x * cos(Pi/18)) * sinh(x * sin(Pi/18)) + 2/9 * cos(x/2*(sqrt(3) * cos(Pi/9) - sin(Pi/9)))* sinh(x/2*(cos(Pi/9) + sqrt(3) * sin(Pi/9))) - 1/9 * cos(Pi/9) * cos(x/2*(sqrt(3) * cos(Pi/9) - sin(Pi/9))) * sinh(x/2*(cos(Pi/9) + sqrt(3) * sin(Pi/9))) - (cos(x/2*(sqrt(3) * cos(Pi/9) - sin(Pi/9))) * sin(Pi/9)* sinh(x/2*(cos(Pi/9) + sqrt(3) * sin(Pi/9))))/ (3 * sqrt(3)) - (cos(Pi/9) * sin(x/2*(sqrt(3) * cos(Pi/9) - sin(Pi/9)))* sinh(x/2*(cos(Pi/9) + sqrt(3) * sin(Pi/9))))/ (3 * sqrt(3)) + 1/9 * sin(Pi/9)* sin(x/2*(sqrt(3) * cos(Pi/9) - sin(Pi/9)))* sinh(x/2*(cos(Pi/9) + sqrt(3) * sin(Pi/9)))). - 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

Views

Author

Alois P. Heinz, Oct 12 2013

Keywords

Crossrefs

Programs

  • Maple
    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);
  • Mathematica
    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 *)

Formula

E.g.f.: 1 / Sum_{n>=0} (10*n+1-x)*x^(10*n)/(10*n+1)!.
a(n)/n! ~ c * (1/r)^n, where r = 1.0000002505217051890946793081039639693008257169189079028339632923816... is the root of the equation Sum_{n>=0} (r^(10*n)/(10*n)! - r^(10*n+1)/(10*n+1)!) = 0, c = 1.000002229648140602899529055054469878816530201510267349345270187155... . - Vaclav Kotesovec, Jan 17 2015
E.g.f.: 10 / (2/exp(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))). - Vaclav Kotesovec, Jan 31 2015
In closed form, c = 5 / (r * (sqrt(10 - 2*sqrt(5)) * cosh((sqrt(5)+1)*r/4) * sin(sqrt((5 - sqrt(5))/2)*r/2) + sqrt(2*(5 + sqrt(5))) * cosh((sqrt(5)-1)*r/4) * sin(sqrt((5 + sqrt(5))/2)*r/2))). - Vaclav Kotesovec, Feb 01 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

Views

Author

Alois P. Heinz, Oct 12 2013

Keywords

Crossrefs

Programs

  • Maple
    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);
  • Mathematica
    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 *)

Formula

E.g.f.: 1 / Sum_{n>=0} (11*n+1-x)*x^(11*n)/(11*n+1)!.
a(n)/n! ~ 1.000000227556759905306252970186381144189779110025896440589711080508... * (1/r)^n, where r = 1.000000022964438439732421879840792836238519233492197325926442472620564... is the root of the equation Sum_{n>=0} (r^(11*n)/(11*n)! - r^(11*n+1)/(11*n+1)!) = 0. - Vaclav Kotesovec, Jan 17 2015
E.g.f.: -11/(2*((-cos(x*cos(Pi/22)))* cosh(x*sin(Pi/22)) - cos(x*cos(3*Pi/22))* cosh(x*sin(3*Pi/22)) - cos(x*cos(5*Pi/22))* cosh(x*sin(5*Pi/22)) - cos(x*cos(Pi/22))* cosh(x*sin(Pi/22))*sin(Pi/22) + cos(x*cos(3*Pi/22))* cosh(x*sin(3*Pi/22))* sin(3*Pi/22) - cos(x*cos(5*Pi/22))* cosh(x*sin(5*Pi/22))* sin(5*Pi/22) + cos(Pi/22)* cosh(x*sin(Pi/22))* sin(x*cos(Pi/22)) + cos(3*Pi/22)*cosh( x*sin(3*Pi/22))* sin(x*cos(3*Pi/22)) + cos(5*Pi/22)*cosh( x*sin(5*Pi/22))* sin(x*cos(5*Pi/22)) - cosh(x*cos(Pi/11))* ((1 + cos(Pi/11))* cos(x*sin(Pi/11)) - sin(Pi/11)*sin(x*sin(Pi/11))) + cosh(x*cos(2*Pi/11))* ((-1 + cos(2*Pi/11))* cos(x*sin(2*Pi/11)) + sin(2*Pi/11)* sin(x*sin(2*Pi/11))) + cos(x*sin(Pi/11))* sinh(x*cos(Pi/11)) + cos(Pi/11)*cos(x*sin(Pi/11))* sinh(x*cos(Pi/11)) - sin(Pi/11)*sin(x*sin(Pi/11))* sinh(x*cos(Pi/11)) - cos(x*sin(2*Pi/11))* sinh(x*cos(2*Pi/11)) + cos(2*Pi/11)* cos(x*sin(2*Pi/11))* sinh(x*cos(2*Pi/11)) + sin(2*Pi/11)* sin(x*sin(2*Pi/11))* sinh(x*cos(2*Pi/11)) + cos(x*cos(Pi/22))* sinh(x*sin(Pi/22)) + cos(x*cos(Pi/22))*sin(Pi/22)* sinh(x*sin(Pi/22)) - cos(Pi/22)*sin(x*cos(Pi/22))* sinh(x*sin(Pi/22)) - cos(x*cos(3*Pi/22))* sinh(x*sin(3*Pi/22)) + cos(x*cos(3*Pi/22))* sin(3*Pi/22)* sinh(x*sin(3*Pi/22)) + cos(3*Pi/22)* sin(x*cos(3*Pi/22))* sinh(x*sin(3*Pi/22)) + cos(x*cos(5*Pi/22))* sinh(x*sin(5*Pi/22)) + cos(x*cos(5*Pi/22))* sin(5*Pi/22)* sinh(x*sin(5*Pi/22)) - cos(5*Pi/22)* sin(x*cos(5*Pi/22))* sinh(x*sin(5*Pi/22)))). - Vaclav Kotesovec, Jan 31 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

Views

Author

Alois P. Heinz, Oct 30 2013

Keywords

Examples

			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;
		

Crossrefs

Columns k=0-2 give: A177520, A230832, A264077.
T(2n-1,n-2) gives A000182(n) for n>=3.
Row sums give: A000142.

Programs

  • Maple
    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
  • Mathematica
    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

Views

Author

Alois P. Heinz, Oct 25 2013

Keywords

Examples

			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;
		

Crossrefs

Columns k=0-1 give: A177477, A227883.
T(2n,n-1) gives A000364(n) for n>=2.
Row sums give: A000142.

Programs

  • Maple
    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);
  • Mathematica
    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

Views

Author

Alois P. Heinz, Sep 12 2020

Keywords

Examples

			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).
		

Crossrefs

Programs

  • Maple
    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);

Formula

a(n) = A060351(n,n).
a(2^n-1) = binomial(2^n-2,n).
a(2^n) = binomial(2^n,n+1)-1.

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

Views

Author

Alois P. Heinz, Oct 27 2013

Keywords

Examples

			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;
		

Crossrefs

Column k=0 gives: A177519.
Row sums give: A000142.

Programs

  • Maple
    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);
  • Mathematica
    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

Views

Author

Alois P. Heinz, May 22 2014

Keywords

Examples

			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).
		

Crossrefs

Column k=0 of A242783.
Main diagonal of A242784.
Cf. A335308.

Programs

  • Maple
    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);
  • Mathematica
    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 *)
Previous Showing 11-20 of 56 results. Next