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.

Showing 1-6 of 6 results.

A242784 Number A(n,k) of permutations of [n] avoiding the consecutive step pattern given by the binary expansion of k, where 1=up and 0=down; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 4, 1, 1, 1, 1, 2, 5, 8, 1, 1, 1, 1, 2, 6, 17, 16, 1, 1, 1, 1, 2, 6, 21, 70, 32, 1, 1, 1, 1, 2, 6, 19, 90, 349, 64, 1, 1, 1, 1, 2, 6, 21, 70, 450, 2017, 128, 1, 1, 1, 1, 2, 6, 23, 90, 331, 2619, 13358, 256, 1, 1
Offset: 0

Views

Author

Alois P. Heinz, May 22 2014

Keywords

Examples

			A(4,5) = 19 because there are 4! = 24 permutations of {1,2,3,4} and only 5 of them do not avoid the consecutive step pattern up, down, up given by the binary expansion of 5 = 101_2: (1,3,2,4), (1,4,2,3), (2,3,1,4), (2,4,1,3), (3,4,1,2).
Square array A(n,k) begins:
  1, 1,   1,     1,     1,     1,     1,     1,     1, ...
  1, 1,   1,     1,     1,     1,     1,     1,     1, ...
  1, 1,   2,     2,     2,     2,     2,     2,     2, ...
  1, 1,   4,     5,     6,     6,     6,     6,     6, ...
  1, 1,   8,    17,    21,    19,    21,    23,    24, ...
  1, 1,  16,    70,    90,    70,    90,   111,   116, ...
  1, 1,  32,   349,   450,   331,   450,   642,   672, ...
  1, 1,  64,  2017,  2619,  1863,  2619,  4326,  4536, ...
  1, 1, 128, 13358, 17334, 11637, 17334, 33333, 34944, ...
		

Crossrefs

Columns give: 0, 1: A000012, 2: A011782, 3: A049774, 4, 6: A177479, 5: A177477, 7: A117158, 8, 14: A177518, 9: A177519, 10: A177520, 11, 13: A177521, 12: A177522, 15: A177523, 16, 30: A177524, 17: A177525, 18, 22: A177526, 19, 25: A177527, 20, 26: A177528, 21: A177529, 23, 29: A177530, 24, 28: A177531, 27: A177532, 31: A177533, 32, 62: A177534, 33: A177535, 34, 46: A177536, 35, 49: A177537, 36, 54: A177538, 37, 41: A177539, 38: A177540, 39, 57: A177541, 40, 58: A177542, 42: A177543, 43, 53: A177544, 44, 50: A177545, 45: A177546, 47, 61: A177547, 48, 60: A177548, 51: A177549, 52: A177550, 55, 59: A177551, 56: A177552, 63: A177553, 127: A230051, 255: A230231, 511: A230232, 1023: A230233, 2047: A254523.
Main diagonal gives A242785.

Programs

  • Maple
    A:= proc(n, k) option remember; local b, m, r, h;
          if k<2 then return 1 fi;
          m:= iquo(k, 2, 'r'); h:= 2^ilog2(k);
          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(seq(A(n, d-n), n=0..d), d=0..15);
  • Mathematica
    Clear[A]; A[n_, k_] := A[n, k] = Module[{b, m, r, h}, If[k < 2, Return[1]]; {m, r} = QuotientRemainder[k, 2]; h = 2^Floor[Log[2, k]]; 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[2*t, h]], {j, 1, u}]] + If[t == m && r == 1, 0, Sum[b[u + j - 1, o - j, Mod[2*t + 1, h]], {j, 1, o}]]]; b[n, 0, 0]]; Table[Table[A[n, d - n], {n, 0, d}], {d, 0, 15}] // Flatten (* Jean-François Alcover, Sep 22 2014, translated from Maple *)

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

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

A230235 Number of permutations of [n] in which the longest increasing run has length 9.

Original entry on oeis.org

1, 18, 287, 4512, 72540, 1209936, 21064680, 383685120, 7315701120, 145957544981, 3044416187213, 66312765615259, 1506481046115907, 35648661471454418, 877558860954150150, 22444760416001869200, 595702609788740888400, 16387438983202886695200
Offset: 9

Views

Author

Alois P. Heinz, Oct 12 2013

Keywords

Crossrefs

Column k=9 of A008304.

Programs

  • Maple
    b:= proc(u, o, t, k) option remember; `if`(u+o=0, 1,
          `if`(t b(n, 0, 0, 9)-b(n, 0, 0, 8):
    seq(a(n), n=9..30);

Formula

E.g.f.: 1/Sum_{n>=0} (10*n+1-x)*x^(10*n)/(10*n+1)! - 1/Sum_{n>=0} (9*n+1-x)*x^(9*n)/(9*n+1)!.
a(n) = A230232(n) - A230231(n).

A230236 Number of permutations of [n] in which the longest increasing run has length 10.

Original entry on oeis.org

1, 20, 349, 5954, 103194, 1845480, 34288800, 663848640, 13406178240, 282398538240, 6201593613645, 141859542537845, 3376683552323421, 83546513273754977, 2146303277645066980, 57187254952684274700, 1578640101972070456800, 45101111852055549981600
Offset: 10

Views

Author

Alois P. Heinz, Oct 12 2013

Keywords

Crossrefs

Column k=10 of A008304.

Programs

  • Maple
    b:= proc(u, o, t, k) option remember; `if`(u+o=0, 1,
          `if`(t b(n, 0, 0, 10)-b(n, 0, 0, 9):
    seq(a(n), n=10..30);

Formula

E.g.f.: 1/Sum_{n>=0} (11*n+1-x)*x^(11*n)/(11*n+1)! - 1/Sum_{n>=0} (10*n+1-x)*x^(10*n)/(10*n+1)!.
a(n) = A230233(n) - A230232(n).

A254523 Number of permutations of [n] avoiding adjacent step pattern {up}^11.

Original entry on oeis.org

1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001599, 6227020775, 87178290682, 1307674357710, 20922789683040, 355687423926240, 6402373618334400, 121645098513933120, 2432901965590252800, 51090941178938707200, 1124000703770606323200
Offset: 0

Views

Author

Vaclav Kotesovec, Jan 31 2015

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(u, o, t) option remember; `if`(u+o=0, 1,
          `if`(t<10, 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); # after Alois P. Heinz
  • Mathematica
    CoefficientList[Series[6 / (Exp[-x] + Cos[x] + 2*Cos[x/2] * Cosh[Sqrt[3]*x/2] - Cosh[Sqrt[3]*x/2]*Sin[x/2] - Sin[x] + Cosh[x/2] * (2*Cos[Sqrt[3]*x/2] - Sqrt[3]*Sin[Sqrt[3]*x/2]) - Cos[Sqrt[3]*x/2]*Sinh[x/2] - Sqrt[3]*Cos[x/2]*Sinh[Sqrt[3]*x/2]), {x, 0, 25}], x] * Range[0, 25]!

Formula

E.g.f.: 1 / Sum_{n>=0} (12*n+1-x)*x^(12*n)/(12*n+1)!.
E.g.f.: 6 / (exp(-x) + cos(x) + 2*cos(x/2)*cosh(sqrt(3)*x/2) - cosh(sqrt(3)*x/2)*sin(x/2) - sin(x) + cosh(x/2)*(2*cos(sqrt(3)*x/2) - sqrt(3)*sin(sqrt(3)*x/2)) - cos(sqrt(3)*x/2)*sinh(x/2) - sqrt(3)*cos(x/2)*sinh(sqrt(3)*x/2)).
a(n)/n! ~ c * (1/r)^n, where r = 1.0000000019270853046730165249753673978954992128247736041276... is the root of the equation Sum_{n>=0} (r^(12*n)/(12*n)! - r^(12*n+1)/(12*n+1)!) = 0, equivalently root of the equation exp(-r) + cos(r) + 2*cos(r/2)*cosh(sqrt(3)*r/2) - cosh(sqrt(3)*r/2)*sin(r/2) - sin(r) + cosh(r/2)*(2*cos(sqrt(3)*r/2) - sqrt(3)*sin(sqrt(3)*r/2)) - cos(sqrt(3)*r/2)*sinh(r/2) - sqrt(3)*cos(r/2)*sinh(sqrt(3)*r/2) = 0, c = 3/(r*sqrt((cosh(sqrt(3)*r/2) * sin(r/2) + sin(r))^2 + 2*sqrt(3)*cosh(r/2) * (cosh(sqrt(3)*r/2) * sin(r/2) + sin(r)) * sin(sqrt(3)*r/2) + 3*cosh(r/2)^2 * sin((sqrt(3)*r)/2)^2)) = 1.0000000210373483515818712802156496756788404534079689145773611990529818919... .
Showing 1-6 of 6 results.