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 81-90 of 190 results. Next

A097860 Triangle read by rows: T(n,k) is the number of Motzkin paths of length n with k peaks (n>=0, 0<=k<=floor(n/2)).

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 4, 4, 1, 8, 10, 3, 17, 24, 9, 1, 37, 58, 28, 4, 82, 143, 81, 16, 1, 185, 354, 231, 60, 5, 423, 881, 653, 205, 25, 1, 978, 2204, 1824, 676, 110, 6, 2283, 5534, 5058, 2164, 435, 36, 1, 5373, 13940, 13946, 6756, 1631, 182, 7, 12735, 35213, 38262, 20710
Offset: 0

Views

Author

Emeric Deutsch, Sep 01 2004

Keywords

Comments

Row sums are the Motzkin numbers (A001006). Column 0 gives A004148.
This triangle is the Motzkin path equivalent to the Narayana numbers (A001263). - Dan Drake, Feb 17 2011

Examples

			Triangle starts:
   1;
   1;
   1,  1;
   2,  2;
   4,  4, 1;
   8, 10, 3;
  17, 24, 9, 1;
  ...
Row n has 1+floor(n/2) terms.
T(4,1)=4 because (UD)HH, H(UD)H, HH(UD) and U(UD)D are the only Motzkin paths of length 4 with 1 peak (here U=(1,1), H=(1,0) and D=(1,-1)); peaks are shown between parentheses.
		

Crossrefs

Programs

  • Maple
    eq:=G=1+z*G+z^2*G*(G-1+t):sol:=solve(eq,G): G:=sol[2]: Gser:=simplify(series(G,z=0,16)): P[0]:=1: for n from 1 to 13 do P[n]:=sort(coeff(Gser,z^n)) od: seq(seq(coeff(t*P[n],t^k),k=1..1+floor(n/2)),n=0..13);
    # Alternatively
    A097860_row := proc(n) local w,f,p,i;
    w := 1-x+x^2-x^2*t; f := (w-sqrt(w^2-4*x^2))/(2*x^2);
    p := simplify(coeff(series(f,x,3+2*n),x,n));
    seq(coeff(p,t,i), i=0..iquo(n,2)) end:
    seq(print(A097860_row(n)), n=0..7); # Peter Luschny, Nov 14 2014
    # third Maple program:
    b:= proc(x, y, t) option remember; expand(`if`(y<0 or y>x, 0,
         `if`(x=0, 1, b(x-1, y, 1)+b(x-1, y-1, 1)*t+b(x-1, y+1, z))))
        end:
    T:= n-> (p-> seq(coeff(p, z, i), i=0..degree(p)))(b(n, 0, 1)):
    seq(T(n), n=0..15);  # Alois P. Heinz, Feb 01 2019
  • Mathematica
    gf = With[{w = 1 - x + x^2 - x^2*t}, (w - Sqrt[w^2 - 4*x^2])/(2*x^2)];
    cx[n_] := cx[n] = SeriesCoefficient[gf, {x, 0, n}];
    T[n_, k_] := SeriesCoefficient[cx[n], {t, 0, k}];
    Table[T[n, k], {n, 0, 14}, {k, 0, n/2}] // Flatten (* Jean-François Alcover, Dec 04 2017, after Peter Luschny *)

Formula

G.f. G = G(t, z) satisfies G = 1+z*G+z^2*G*(G-1+t).
G.f. has explicit form G(x,t) = (w-sqrt(w^2-4*x^2))/(2*x^2) with w = 1-x+x^2-x^2*t. (Drake and Ganter, Th. 6) - Peter Luschny, Nov 14 2014

A098056 Triangle read by rows: T(n,k) = number of peakless Motzkin paths of length n containing k subwords of the type uh^ju, dH^jd, or dh^ju for some j>0, where u=(1,1), d=(1,-1) and h=(1,0) (can be easily expressed using RNA secondary structure terminology).

Original entry on oeis.org

1, 1, 1, 2, 4, 8, 15, 2, 27, 9, 1, 48, 29, 5, 84, 80, 21, 147, 198, 74, 4, 257, 463, 230, 27, 1, 451, 1033, 667, 125, 7, 796, 2235, 1811, 488, 43, 1413, 4727, 4694, 1676, 219, 6, 2526, 9828, 11700, 5317, 946, 54, 1, 4544, 20192, 28252, 15813, 3696, 326, 9, 8226, 41100
Offset: 0

Views

Author

Emeric Deutsch, Sep 11 2004

Keywords

Comments

Row sums are the RNA secondary structure numbers (A004148).
T(n,0) = A098057(n).
Sum(k*T(n,k),k>=0) = A187259(n).

Examples

			Triangle starts:
  1;
  1;
  1;
  2;
  4;
  8;
  15,2;
  27,9,1;
  48,29,5;
  84.80,21;
  147,198,74,7;
  ...
It seems that the number r(n) of terms in row n>=3 is given by r(n)=n/2-1 if n=2 (mod 4) and r(n)=2*round(n/4)-1 otherwise (here round(m) is the nearest integer to m).
T(7,1)=9 because we have h(uhu)hdd, (uhhu)hdd, (uhu)hhdd, (uhu)hddh, uh(dhu)hd and the reflections of the first four paths in a vertical axis; here u=(1,1), h=(1,0), d=(1,-1) and the pertinent subwords are shown between parentheses.
		

Crossrefs

Formula

G.f.=G=G(t, z) satisfies G = 1 + zG + z^2*[H + 2tzH/(1-z)+t^2*z^2*H/(1-z)^2+ z/(1-z)][G-(1-t)zH/(1-z)^2], where H=(1-z)^2*G-1+z.
The 4-variate g.f. G(t,s,v,z) of peakless Motzkin paths, where t, s, v mark subwords of the types uH^ju, dH^jd, dH^ju, respectively, and z marks length, satisfies the equation
G = 1+zG+z^2*[H + (t+s)zH/(1-z)+tsz^2*H/(1-z)^2+z/(1-z)][G-(1-v)zH/(1-z)^2],
where H = (1-z)[(1-z)G-1]. As special cases we get the current sequence A098056 and the sequences A097777 and A098083.

A098057 Number of peakless Motzkin paths with no U H^j U, no D H^j D and no D H^jU (j>0), where U=(1,1), D=(1,-1) and H=(1,0) (can be easily expressed using RNA secondary structure terminology).

Original entry on oeis.org

1, 1, 1, 2, 4, 8, 15, 27, 48, 84, 147, 257, 451, 796, 1413, 2526, 4544, 8226, 14978, 27417, 50434, 93183, 172865, 321857, 601263, 1126644, 2116968, 3987960, 7530200, 14249649, 27019301, 51327965, 97676156, 186177568, 355406479, 679425009
Offset: 0

Views

Author

Emeric Deutsch, Sep 11 2004

Keywords

Examples

			a(4)=4 because we have HHHH, UHDU, HUHD and UHHD; a(6)=15 because from all 17 peakless Motzkin paths of length 6 (see A004148) only (UHU)HDD and UUH(DHD) do not qualify.
		

Crossrefs

Cf. A004148.

Formula

G.f.: [1-z+z^2-4z^3+2z^4-sqrt(1-2z-z^2+2z^3+z^4-4z^5+4z^6)]/[2z^2*(1-z)^3].
D-finite with recurrence (n+2)*a(n) +(-5*n-7)*a(n-1) +2*(4*n+5)*a(n-2) +(-2*n-13)*a(n-3) +3*(-2*n+5)*a(n-4) +18*(1)*a(n-5) +(17*n-101)*a(n-6) +(-25*n+154)*a(n-7) +2*(8*n-53)*a(n-8) +4*(-n+7)*a(n-9)=0. - R. J. Mathar, Jul 26 2022

A098071 Triangle read by rows: T(n,k) is number of peakless Motzkin paths of length n and having k uhh...hd's starting at level 0, where u=(1,1), h=(1,0) and d=(1,-1) (can be easily expressed using RNA secondary structure terminology).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 3, 2, 6, 6, 10, 1, 17, 15, 5, 44, 23, 15, 107, 42, 35, 1, 252, 94, 70, 7, 588, 233, 129, 28, 1376, 585, 237, 84, 1, 3245, 1441, 468, 210, 9, 7717, 3481, 1026, 466, 45, 18485, 8319, 2434, 968, 165, 1, 44535, 19835, 5972, 1984, 495, 11, 107796, 47436
Offset: 0

Views

Author

Emeric Deutsch, Sep 13 2004

Keywords

Comments

Row sums are the RNA secondary structure numbers (A004148).
T(n,0)=A190159(n).
Row n has 1+floor(n/3) terms.
Sum(k*T(n,k),k>=0) = A187260.

Examples

			Triangle starts:
1;
1;
1;
1,1;
1,3;
2,6;
6,10,1;
17,15,5;
44,23,15;
107,42,35,1;
T(6,2)=1 because we have (uhd)(uhd) (the two pertinent subwords are shown between parentheses).
		

Crossrefs

Formula

G.f.: G=G(t, z) satisfies aG^2 + bG + c = 0, where a=z^2*(1-z-z^2+2z^3-tz+2tz^2-2tz^3-tz^4+t^2z^4), b=-(1-z)(1-2z+2z^2+z^3-2tz^3), c=(1-z)^2.
The g.f. H(t,z), counting peakless Motzkin paths by the number of UH^bD (b is fixed) starting at level 0 (marked by t) and by length (marked by z), satisfies the equation H=1+zH+z^2*H(g-1-z^b + tz^b), where g=1+zg+z^2*g(g-1).

A110318 Number of arcs covered by other arcs in all RNA secondary structures of size n+5 (i.e., with n+5 nodes).

Original entry on oeis.org

1, 5, 17, 53, 157, 448, 1250, 3434, 9326, 25114, 67196, 178895, 474398, 1254072, 3306738, 8701193, 22857026, 59958380, 157098360, 411214120, 1075491286, 2810892598, 7342205478, 19168694232, 50023584613, 130497101659, 340325126923, 887307420361
Offset: 0

Views

Author

Emeric Deutsch, Jul 19 2005

Keywords

Examples

			a(0)=1 because in the 8 (=A004148(5)) RNA secondary structures of size 5, namely 1/2/3/4/5, 13/2/4/5, 14/2/3/5, 15/2/3/4, 1/24/3/5, 1/25/3/4, 1/2/35/4 and 15/24/3 we have altogether 1 arc covered by another arc: in 15/24/3 the arc 24 is covered by the arc 15.
		

Crossrefs

Programs

  • Maple
    Q:=sqrt(1-2*z-z^2-2*z^3+z^4): G:=2*(1-2*z-z^3-(1-z)*Q)/Q/z^5/(1-z+z^2+Q)^2: Gser:=series(G,z=0,38): 1,seq(coeff(Gser,z^n),n=1..30);
  • Mathematica
    CoefficientList[Series[2 (1 - 2 x - x^3 - (1 - x) Sqrt[1 - 2 x - x^2 - 2 x^3 + x^4]) / (x^5 Sqrt[1 - 2 x - x^2 - 2 x^3 + x^4] (1 - x + x^2 + Sqrt[1 - 2 x - x^2 - 2 x^3 + x^4])^2), {x, 0, 33}], x] (* Vincenzo Librandi, Jun 13 2017 *)

Formula

G.f.: 2(1-2z-z^3-(1-z)Q)/(z^5*Q(1-z+z^2+Q)^2), where Q:=sqrt(1-2z-z^2-2z^3+z^4).
a(n) = Sum_{k>=0} k*A110317(n+5,k).

A110333 Triangle read by rows: T(n,k) (n,k>=0) = number of peakless Motzkin paths of length n having k valleys (i.e., (1,-1) followed by (1,1)) at level zero (can be easily translated into RNA secondary structure terminology).

Original entry on oeis.org

1, 1, 1, 2, 4, 8, 16, 1, 33, 4, 70, 12, 152, 32, 1, 336, 82, 5, 754, 206, 18, 1714, 512, 56, 1, 3940, 1264, 163, 6, 9145, 3109, 456, 25, 21406, 7634, 1243, 88, 1, 50478, 18737, 3326, 284, 7, 119814, 46006, 8781, 868, 33, 286045, 113062, 22955, 2556, 129, 1, 686456
Offset: 0

Views

Author

Emeric Deutsch, Jul 20 2005

Keywords

Comments

Row n (n >= 3) has floor(n/3) terms.
Row sums yield the RNA secondary structure numbers (A004148).

Examples

			T(10,2)=5 because we have HUH(DU)H(DU)HD, UH(DU)H(DU)HDH, UHH(DU)H(DU)HD, UH(DU)HH(DU)HD and UH(DU)H(DU)HHD, where U=(1,1), H=(1,0), D=(1,-1) and the valleys at level zero are shown between parentheses.
Triangle begins:
    1;
    1;
    1;
    2;
    4;
    8;
   16,  1;
   33,  4;
   70, 12;
  152, 32,  1;
  336, 62,  5;
		

Crossrefs

Programs

  • Maple
    g:=(1-z+z^2-sqrt(1-2*z-z^2-2*z^3+z^4))/2/z^2: G:=(1+z^2*g-z^2*g*t-z^2+t*z^2)/(1-z-z^3*g-t*z^2*g+t*z^3*g+z^3+t*z^2-t*z^3): Gser:=simplify(series(G,z=0,23)): P[0]:=1: for n from 1 to 20 do P[n]:=coeff(Gser,z^n) od: for n from 0 to 2 do print(1) od: for n from 3 to 20 do seq(coeff(t*P[n],t^k),k=1..floor(n/3)) od; # yields sequence in triangular form

Formula

T(n,0) = A110334(n).
Sum_{k>=0} k*T(n,k) = A110335(n-6) for n >= 6, 0 otherwise.
G.f.: (1 + z^2*g - tz^2*g - z^2 + tz^2)/(1 - z - z^3*g - tz^2*g + tz^3*g + z^3 + tz^2 - tz^3), where g = 1 + zg + z^2*g(g-1) = (1 - z + z^2 - sqrt(1 - 2z - z^2 - 2z^3 + z^4))/(2z^2) is the g.f. of the RNA secondary structure numbers (A004148).

Extensions

Keyword tabf added by Michel Marcus, Apr 09 2013

A166285 Triangle read by rows: T(n,k) is the number of Dyck paths with no UUU's and no DDD's, of semilength n having k peak plateaux (0 <= k <= floor(n/3); U=(1,1), D=(1,-1)).

Original entry on oeis.org

1, 1, 2, 3, 1, 5, 3, 9, 8, 17, 19, 1, 34, 43, 5, 70, 97, 18, 147, 219, 56, 1, 313, 498, 160, 7, 673, 1140, 438, 32, 1459, 2623, 1168, 122, 1, 3185, 6061, 3062, 418, 9, 6995, 14053, 7932, 1342, 50, 15445, 32677, 20360, 4124, 225, 1, 34265, 76171, 51886, 12274, 895
Offset: 0

Views

Author

Emeric Deutsch, Oct 12 2009

Keywords

Comments

A peak plateau is a run of consecutive peaks that is preceded by an upstep U and followed by a down step D; a peak consists of an upstep followed by a downstep.
Row n contains 1 + floor(n/3) entries.
Sum of entries in row n = A004148(n+1) (the secondary structure numbers).
T(n,0) = A166286(n).
Sum_{k=0..floor(n/3)} k*T(n,k) = A166287(n).

Examples

			T(4,1)=3 because we have UD(UUDUDD), (UUDUDD)UD, and (UUDUDUDD) (the peak plateaux are shown between parentheses).
Triangle starts:
   1;
   1;
   2;
   3,  1;
   5,  3;
   9,  8;
  17, 19,  1;
  34, 43,  5;
		

Crossrefs

Programs

  • Maple
    F := RootOf(G = 1+z*G+z^2*G+z^3*G*((t-1)/(1-z)+G), G): Fser := series(F, z = 0, 20): for n from 0 to 17 do P[n] := sort(coeff(Fser, z, n)) end do: for n from 0 to 17 do seq(coeff(P[n], t, j), j = 0 .. floor((1/3)*n)) end do; # yields sequence in triangular form

Formula

G.f. G=G(t,z) satisfies G = 1 + zG + z^2*G + z^3*G[G+(t-1)/(1-z)].

A166295 Triangle read by rows: T(n,k) is the number of Dyck paths with no UUU's and no DDD's, of semilength n and having k UUDUDD's starting at level 0 (0 <= k <= floor(n/3); U=(1,1), D=(1,-1)).

Original entry on oeis.org

1, 1, 2, 3, 1, 6, 2, 12, 5, 26, 10, 1, 57, 22, 3, 128, 48, 9, 291, 109, 22, 1, 670, 250, 54, 4, 1558, 582, 129, 14, 3655, 1366, 311, 40, 1, 8639, 3232, 750, 109, 5, 20554, 7696, 1818, 284, 20, 49185, 18432, 4419, 730, 65, 1, 118301, 44368, 10776, 1856, 195, 6
Offset: 0

Views

Author

Emeric Deutsch, Oct 29 2009

Keywords

Comments

Row n has 1 + floor(n/3) terms.
Sum of entries in row n = A004148(n+1) (the secondary structure numbers).
T(n,0) = A166296(n).
Sum_{k=0..floor(n/3)} k*T(n,k) = A166297(n).

Examples

			T(4,1)=2 because we have UDUUDUDD and UUDUDDUD.
Triangle starts:
   1;
   1;
   2;
   3,  1;
   6,  2;
  12,  5;
  26, 10,  1;
		

Crossrefs

Programs

  • Maple
    G := 2/(1-z-z^2+2*z^3-2*t*z^3+sqrt(1-2*z-z^2-2*z^3+z^4)): Gser := simplify(series(G, z = 0, 20)): for n from 0 to 16 do P[n] := sort(coeff(Gser, z, n)) end do: for n from 0 to 16 do seq(coeff(P[n], t, j), j = 0 .. floor((1/3)*n)) end do; # yields sequence in triangular form

Formula

G.f.: G(t,z) = 1/(1-z-z^2+z^3-t*z^3-z^3*g), where g = 1+zg + z^2*g + z^3*g^2.

A166299 Triangle read by rows: T(n,k) is the number of Dyck paths of semilength n, having no ascents and no descents of length 1, and having k UUDD's starting at level 0.

Original entry on oeis.org

1, 0, 0, 1, 1, 0, 1, 0, 1, 2, 2, 0, 5, 2, 0, 1, 10, 4, 3, 0, 22, 11, 3, 0, 1, 50, 22, 6, 4, 0, 113, 49, 18, 4, 0, 1, 260, 114, 36, 8, 5, 0, 605, 260, 81, 26, 5, 0, 1, 1418, 604, 193, 52, 10, 6, 0, 3350, 1419, 444, 118, 35, 6, 0, 1, 7967, 3350, 1041, 288, 70, 12, 7, 0, 19055, 7966
Offset: 0

Views

Author

Emeric Deutsch, Nov 07 2009

Keywords

Comments

Sum of entries in row n is the secondary structure number A004148(n-1) (n>=2).
Number of entries in row n is 1 + floor(n/2).
T(n,0)=A166300(n).
Sum(k*T(n,k), k>=0)=A075125(n+2).

Examples

			T(7,2)=3 because we have (UUDD)(UUDD)UUUDDD, (UUDD)UUUDDD(UUDD), and UUUDDD(UUDD)(UUDD) (the UUDD's starting at level 0 are shown between parentheses).
Triangle starts:
1;
0;
0,1;
1,0;
1,0,1;
2,2,0;
5,2,0,1;
10,4,3,0;
		

Crossrefs

Programs

  • Maple
    G := 2/(1+z+z^2+sqrt((1+z+z^2)*(1-3*z+z^2))-2*t*z^2): Gser := simplify(series(G, z = 0, 18)): for n from 0 to 16 do P[n] := sort(coeff(Gser, z, n)) end do: for n from 0 to 16 do seq(coeff(P[n], t, k), k = 0 .. floor((1/2)*n)) end do; # yields sequence in triangular form

Formula

G.f.=G(t,z)=1/(1 + z - zg - tz^2), where g=g(z) satisfies g=1 + zg(g - 1 + z).
G.f. of column k is z^{2k}/(1 + z - zg)^{k+1} (k>=0).
G(t,z)=2/[1+z+z^2+sqrt((1+z+z^2)(1-3z+z^2)-2tz^2)].

A190159 Number of peakless Motzkin paths of length n and having no uhh...hd's starting at level 0, where u = (1, 1), h = (1, 0) and d = (1, -1).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 6, 17, 44, 107, 252, 588, 1376, 3245, 7717, 18485, 44535, 107796, 261937, 638673, 1562105, 3831655, 9423580, 23233536, 57412612, 142174255, 352770105, 876922947, 2183621209, 5446177428, 13603846132, 34028890577, 85234251090, 213760737693, 536733871490, 1349210120198
Offset: 0

Views

Author

Emeric Deutsch, May 05 2011

Keywords

Comments

Can be easily expressed using RNA secondary structure terminology.

Examples

			a(5)=2 because among the 8 (=A004148(5)) peakless Motzkin paths of length 5 only hhhhh and uuhdd have no subword of type uhh...hd starting at level 0.
		

Crossrefs

Programs

  • Magma
    m:=40; R:=PowerSeriesRing(Rationals(), m); Coefficients(R!(((1 -x)/(2*x^2*(1 -x -x^2 +2*x^3)))*(1 -2*x +2*x^2 +x^3 -Sqrt((1-2*x+2*x^2 + x^3)^2 -4*x^2*(1 -x -x^2 +2*x^3))))); // G. C. Greubel, Oct 22 2018
  • Maple
    eq := z^2*(-z^2+2*z^3-z+1)*G^2-(1-z)*(z^3+2*z^2-2*z+1)*G+(1-z)^2 = 0: g := RootOf(eq,G): Gser := series(g,z=0,40): seq(coeff(Gser,z,n), n=0..35);
  • Mathematica
    With[{a = x^2*(1 - x - x^2 + 2*x^3)}, CoefficientList[Series[((1 - x)/(2*a))*(1 - 2*x + 2*x^2 + x^3 - Sqrt[(1 - 2*x + 2*x^2 + x^3)^2 - 4*a]), {x, 0, 40}], x]] (* G. C. Greubel, Oct 22 2018 *)
  • PARI
    x='x+O('x^40); Vec(((1-x)/(2*x^2*(1-x-x^2+2*x^3)))*(1-2*x+2*x^2 + x^3 - sqrt((1-2*x+2*x^2+x^3)^2 -4*x^2*(1-x-x^2+2*x^3)))) \\ G. C. Greubel, Oct 22 2018
    

Formula

a(n) = A098071(n,0).
G.f.=G=G(z) satisfies aG^2 + bG + c = 0, where a=z^2*(1-z-z^2+2z^3), b=-(1-z)(1-2z+2z^2+z^3), c=(1-z)^2.
G.f.: ((1 - x)/(2*x^2*(1 - x - x^2 + 2*x^3)))*(1 - 2*x + 2*x^2 + x^3 - sqrt((1 - 2*x + 2*x^2 + x^3)^2 - 4*x^2*(1 - x - x^2 + 2*x^3))). - G. C. Greubel, Oct 22 2018
D-finite with recurrence -(n+5)*(n+3)*(n-9)*a(n) +(-n^3-17*n^2-15*n+96)*a(n-1) +3*(7*n^3-43*n^2-20*n-40)*a(n-2) +(34*n^3-214*n^2+357*n-450)*a(n-3) -2*(n-3)*(8*n^2-48*n+183)*a(n-4) +(34*n^3-398*n^2+1461*n-1332)*a(n-5) +3*(7*n^3-83*n^2+220*n+196)*a(n-6) +(-n^3+35*n^2-327*n+822)*a(n-7) -(n-11)*(n+3)*(n-9)*a(n-8)=0. - R. J. Mathar, Jul 24 2022
Previous Showing 81-90 of 190 results. Next