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-10 of 15 results. Next

A090344 Number of Motzkin paths of length n with no level steps at odd level.

Original entry on oeis.org

1, 1, 2, 3, 6, 11, 23, 47, 102, 221, 493, 1105, 2516, 5763, 13328, 30995, 72556, 170655, 403351, 957135, 2279948, 5449013, 13063596, 31406517, 75701508, 182902337, 442885683, 1074604289, 2612341856, 6361782007, 15518343597, 37912613631, 92758314874
Offset: 0

Views

Author

Emeric Deutsch, Jan 28 2004

Keywords

Comments

a(n) = number of Motzkin paths of length n that avoid UF. Example: a(3) counts FFF, UDF, FUD but not UFD. - David Callan, Jul 15 2004
Also, number of 1-2 trees with n edges and with thinning limbs. A 1-2 tree is an ordered tree with vertices of outdegree at most 2. A rooted tree with thinning limbs is such that if a node has k children, all its children have at most k children. - Emeric Deutsch and Louis Shapiro, Nov 04 2006

Examples

			a(3)=3 because we have HHH, HUD and UDH, where U=(1,1), D=(1,-1) and H=(1,0).
		

Crossrefs

Programs

  • Magma
    [(&+[Binomial(n-k, k)*Catalan(k): k in [0..Floor(n/2)]]): n in [0..40]]; // G. C. Greubel, Jun 15 2022
    
  • Maple
    C:=x->(1-sqrt(1-4*x))/2/x: G:=C(z^2/(1-z))/(1-z): Gser:=series(G,z=0,40): seq(coeff(Gser,z,n),n=0..36);
    # second Maple program:
    a:= proc(n) option remember; `if`(n<3, (n^2-n+2)/2,
         ((2*n+2)*a(n-1) -(4*n-6)*a(n-3) +(3*n-4)*a(n-2))/(n+2))
        end:
    seq(a(n), n=0..40); # Alois P. Heinz, May 17 2013
  • Mathematica
    Table[HypergeometricPFQ[{1/2, (1-n)/2, -n/2}, {2, -n}, -16], {n, 0, 40}] (* Jean-François Alcover, Feb 20 2015, after Paul Barry *)
  • PARI
    {a(n)=local(A=1+x);for(i=1,n,A=1/(1-x+x*O(x^n))+x^2*A^2+x*O(x^n));polcoeff(A,n)} \\ Paul D. Hanna, Jun 24 2012
    
  • SageMath
    [sum(binomial(n-k,k)*catalan_number(k) for k in (0..(n//2))) for n in (0..40)] # G. C. Greubel, Jun 15 2022

Formula

G.f.: (1-x-sqrt(1-2*x-3*x^2+4*x^3))/(2*x^2*(1-x)).
G.f. satisfies: A(x) = 1/(1-x) + x^2*A(x)^2. - Paul D. Hanna, Jun 24 2012
D-finite with recurrence (n+2)*a(n) = 2*(n+1)*a(n-1) + (3*n-4)*a(n-2) - 2*(2*n-3)*a(n-3). - Vladeta Jovovic, Sep 11 2004
a(n) = Sum_{k=0..floor(n/2)} binomial(n-k, k)*binomial(2*k, k)/(k+1). - Paul Barry, Nov 13 2004
a(n) = 1 + Sum_{k=1..n-1} a(k-1)*a(n-k-1). - Henry Bottomley, Feb 22 2005
G.f.: 1/(1-x-x^2/(1-x^2/(1-x-x^2/(1-x^2/(1-x-x^2/(1-x^2/(1-... (continued fraction). - Paul Barry, Apr 08 2009
With M = an infinite tridiagonal matrix with all 1's in the super and subdiagonals and [1,0,1,0,1,0,...] in the main diagonal and V = vector [1,0,0,0,...] with the rest zeros, the sequence starting with offset 1 = leftmost column iterates of M*V. - Gary W. Adamson, Jun 08 2011
Recurrence (an alternative): (n+2)*a(n) = 3*(n+1)*a(n-1) + (n-4)*a(n-2) - (7*n-13)*a(n-3) + 2*(2*n-5)*a(n-4), n>=4. - Fung Lam, Apr 01 2014
Asymptotics: a(n) ~ (8/(sqrt(17)-1))^n*( 1/17^(1/4) + 17^(1/4) )*17 /(16*sqrt(Pi*n^3)). - Fung Lam, Apr 01 2014
a(n) = 2*A026569(n) + A026569(n+1)/2 - A026569(n+2)/2. - Mark van Hoeij, Nov 29 2024

A052723 Expansion of e.g.f. (1 - x - sqrt(1-2*x+x^2-4*x^3))/(2*x).

Original entry on oeis.org

0, 0, 2, 6, 24, 240, 2880, 35280, 524160, 9434880, 188697600, 4151347200, 101548339200, 2727435110400, 79332244992000, 2488504322304000, 83879464660992000, 3021209014247424000, 115754916599562240000
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Crossrefs

Programs

  • Maple
    spec := [S,{B=Prod(S,S),C=Union(B,S,Z),S=Prod(Z,C)},labeled]: seq(combstruct[count](spec,size=n), n=0..20);
    seq(n!*add(binomial(n-2-k,2*k)*binomial(2*k,k)/(k+1), k=0..floor((n-2)/3)), n=0..18);  # Mark van Hoeij, May 12 2013
  • Mathematica
    With[{nn=20},CoefficientList[Series[(1-x-Sqrt[1-2x+x^2-4x^3])/(2x),{x,0,nn}],x] Range[0,nn]!] (* Harvey P. Dale, Jan 19 2017 *)
    a[n_]:= a[n]= n!*Sum[Binomial[n-k-2,2*k]*CatalanNumber[k], {k,0,Floor[(n-2)/2]}];
    Table[a[n], {n,0,30}] (* G. C. Greubel, May 28 2022 *)
  • SageMath
    def A052723(n): return factorial(n)*sum( binomial(n-k-2, 2*k)*catalan_number(k) for k in (0..(n-2)//2) )
    [A052723(n) for n in (0..30)] # G. C. Greubel, May 28 2022

Formula

D-finite with recurrence: a(0) = a(1) = 0, a(2) = 2, a(3) = 6, a(4) = 24, (n+4)*a(n+3) = (15 + 11*n + 2*n^2)*a(n+2) - (6 + 11*n + 6*n^2 + n^3)*a(n+1) - (12 - 2*n - 32*n^2 - 22*n^2 - 4*n^4)*a(n).
a(n) = n!*A023431(n-2). - R. J. Mathar, Oct 18 2013

A025246 a(n) = a(1)*a(n-1) + a(2)*a(n-2) + ... + a(n-3)*a(3) for n >= 4, with initial terms 1, 0, 1, 1.

Original entry on oeis.org

1, 0, 1, 1, 1, 2, 4, 7, 13, 26, 52, 104, 212, 438, 910, 1903, 4009, 8494, 18080, 38656, 82988, 178802, 386490, 837928, 1821664, 3970282, 8673258, 18987930, 41652382, 91539466, 201525238, 444379907, 981384125, 2170416738, 4806513660, 10657780276
Offset: 1

Views

Author

Keywords

Comments

Essentially the same as A023431.

Crossrefs

Programs

  • Magma
    [n le 2 select 2-n else (&+[Binomial(n-k-3, 2*k)*Catalan(k): k in [0..Floor((n-3)/3)]]): n in [1..45]]; // G. C. Greubel, Jun 15 2022
    
  • Maple
    a := n -> ifelse(n < 3, 0^(n - 1),
       hypergeom([(3 - n)/3, (4 - n)/3, (5 - n)/3], [2, -n + 3], 27)):
    seq(simplify(a(n)), n = 1..32); # Peter Luschny, Jun 15 2022
  • Mathematica
    a[n_]:= a[n]= If[n<4, 1-Boole[n==2], Sum[a[j]*a[n-j], {j,n-3}]];
    Table[a[n], {n, 45}] (* G. C. Greubel, Jun 15 2022 *)
  • PARI
    a(n)=polcoeff((1+x-sqrt(1-2*x+x^2-4*x^3+x*O(x^n)))/2,n)
    
  • SageMath
    [bool(n==1) + sum(binomial(n-k-3,2*k)*catalan_number(k) for k in (0..((n-3)//3))) for n in (1..45)] # G. C. Greubel, Jun 15 2022

Formula

a(n) = A023431(n-3).
G.f.: (1+x-sqrt(1-2*x+x^2-4*x^3))/2. - Michael Somos, Jun 08 2000
n*a(n) = (2*n-3)*a(n-1) -(n-3)*a(n-2) +2*(2*n-9)*a(n-3). - R. J. Mathar, Feb 25 2015
a(n) = hypergeom([(3 - n)/3, (4 - n)/3, (5 - n)/3], [2, 3 - n], 27) for n >= 3. - Peter Luschny, Jun 15 2022

A052702 Expansion of (1/2)*(1/x^2 - 1/x)*(1-x-sqrt(1-2*x+x^2-4*x^3)) - x.

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 3, 6, 13, 26, 52, 108, 226, 472, 993, 2106, 4485, 9586, 20576, 44332, 95814, 207688, 451438, 983736, 2148618, 4702976, 10314672, 22664452, 49887084, 109985772, 242854669, 537004218, 1189032613, 2636096922, 5851266616, 13002628132, 28925389870, 64412505472, 143576017410
Offset: 0

Views

Author

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

Keywords

Comments

From Paul Barry, May 24 2009: (Start)
Hankel transform of A052702 is A160705. Hankel transform of A052702(n+1) is A160706.
Hankel transform of A052702(n+2) is -A131531(n+1). Hankel transform of A052702(n+3) is A160706(n+5).
Hankel transform of A052702(n+4) is A160705(n+5). (End)
For n > 1, number of Dyck (n-1)-paths with each descent length one greater or one less than the preceding ascent length. - David Scambler, May 11 2012

Crossrefs

Cf. A023431.

Programs

  • Maple
    spec := [S,{B=Prod(C,Z),S=Prod(B,B),C=Union(S,B,Z)},unlabeled]: seq(combstruct[count](spec, size=n), n=0..20);
  • Mathematica
    a[n_] := Sum[Binomial[n-k-2, 2k-1] CatalanNumber[k], {k, 0, n-2}];
    Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Oct 11 2022, after Paul Barry *)
  • PARI
    x='x+O('x^66);
    s='a0+(1-2*x+x^2-2*x^3-(1-x)*sqrt(1-2*x+x^2-4*x^3))/(2*x^2);
    v=Vec(s);  v[1]-='a0;  v
    /* Joerg Arndt, May 11 2012 */

Formula

Recurrence: {a(1)=0, a(2)=0, a(4)=1, a(3)=0, a(6)=3, a(7)=6, a(5)=2, (-2+4*n)*a(n)+(-7-5*n)*a(n+1)+(8+3*n)*a(n+2)+(-13-3*n)*a(n+3)+(n+6)*a(n+4)}.
From Paul Barry, May 24 2009: (Start)
G.f.: (1-2*x+x^2-2*x^3-(1-x)*sqrt(1-2*x+x^2-4*x^3))/(2*x^2).
a(n+1) = Sum_{k=0..n-1} C(n-k-1,2k-1)*A000108(k). (End)
a(n) = A023431(n-1)-A023431(n-2). - R. J. Mathar, Jan 13 2025

Extensions

More terms from Joerg Arndt, May 11 2012

A357308 a(0) = a(1) = 0, a(2) = 1; a(n) = a(n-1) + Sum_{k=0..n-3} a(k) * a(n-k-3).

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 1, 2, 4, 7, 11, 16, 24, 39, 67, 116, 196, 324, 534, 892, 1516, 2601, 4463, 7630, 13022, 22276, 38286, 66084, 114328, 197929, 342783, 594218, 1031794, 1794944, 3127450, 5455272, 9523812, 16640542, 29102938, 50951070, 89289998, 156616648, 274923328, 482945930, 848972814
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 23 2022

Keywords

Crossrefs

Programs

  • Mathematica
    a[0] = a[1] = 0; a[2] = 1; a[n_] := a[n] = a[n - 1] + Sum[a[k] a[n - k - 3], {k, 0, n - 3}]; Table[a[n], {n, 0, 44}]
    nmax = 44; A[] = 0; Do[A[x] = x^2 (1 + x A[x]^2)/(1 - x) + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]

Formula

G.f. A(x) satisfies: A(x) = x^2 * (1 + x * A(x)^2) / (1 - x).

A144700 Generalized (3,-1) Catalan numbers.

Original entry on oeis.org

1, 1, 1, 1, 2, 5, 11, 21, 38, 71, 141, 289, 591, 1195, 2410, 4897, 10051, 20763, 42996, 89139, 185170, 385809, 806349, 1689573, 3547152, 7459715, 15714655, 33161821, 70095642, 148388521, 314562189, 667682057, 1418942341
Offset: 0

Views

Author

Paul Barry, Sep 19 2008

Keywords

Comments

Number of lattice paths in the first quadrant from (0,0) to (n,0) using only steps H=(1,0), U=(1,1) and D=(3,-1). Hankel transform has g.f. (1-x^3)/(1+x^4) (A132380 (n+3)).

Crossrefs

Programs

  • Magma
    [(&+[Binomial(n-k,3*k)*Catalan(k): k in [0..Floor(n/4)]]): n in [0..40]]; // G. C. Greubel, Jun 15 2022
    
  • Mathematica
    b[n_, m_]:=a[n, m]=Sum[Binomial[n-k,m*k]*CatalanNumber[k], {k,0,Floor[n/(m+1)]}];
    A144700[n_]:= b[n,3]; (* A014137 (m=0), A090344 (m=1), A023431 (m=2) *)
    Table[A144700[n], {n, 0, 40}] (* G. C. Greubel, Jun 15 2022 *)
  • SageMath
    [sum(binomial(n-k,3*k)*catalan_number(k) for k in (0..(n//4))) for n in (0..40)] # G. C. Greubel, Jun 15 2022

Formula

G.f.: (1/(1-x)) * c(x^4/(1-x)^3), where c(x) is the g.f. of A000108.
a(n) = Sum_{k=0..floor(n/4)} binomial(n-k, 3*k)*A000108(k).
(n+4)*a(n) = 2*(2*n+5)*a(n-1) - 6*(n+1)*a(n-2) + 2*(2*n-1)*a(n-3) +3*(n-2)*a(n-4) - 2*(2*n-7)*a(n-5). - R. J. Mathar, Nov 16 2011
a(n) = b(n, 3), where b(n, m) = Sum_{k=0..floor(n/(m+1))} binomial(n-k, m*k)*A000108(k). - G. C. Greubel, Jun 15 2022

A346503 G.f. A(x) satisfies A(x) = 1 + x^3 * A(x)^2 / (1 - x).

Original entry on oeis.org

1, 0, 0, 1, 1, 1, 3, 5, 7, 14, 26, 43, 79, 148, 264, 483, 903, 1664, 3080, 5771, 10795, 20209, 38059, 71799, 135569, 256762, 487310, 925981, 1762841, 3361897, 6419595, 12275301, 23505143, 45061424, 86485016, 166176499, 319630115, 615387675, 1185940209, 2287527119, 4416083429
Offset: 0

Views

Author

Ilya Gutkovskiy, Jul 21 2021

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 40; A[] = 0; Do[A[x] = 1 + x^3 A[x]^2/(1 - x) + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]
    a[0] = 1; a[1] = a[2] = 0; a[n_] := a[n] = a[n - 1] + Sum[a[k] a[n - k - 3], {k, 0, n - 3}]; Table[a[n], {n, 0, 40}]

Formula

a(0) = 1, a(1) = a(2) = 0; a(n) = a(n-1) + Sum_{k=0..n-3} a(k) * a(n-k-3).
a(n) ~ 2^(n+1) / (sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Jul 30 2021
From Seiichi Manyama, Sep 26 2024: (Start)
G.f.: 2/(1 + sqrt(1 - 4*x^3/(1 - x))).
a(n) = Sum_{k=0..floor(n/3)} binomial(2*k,k) * binomial(n-2*k-1,n-3*k) / (k+1). (End)

A346504 G.f. A(x) satisfies: A(x) = 1 + x + x^3 * A(x)^2 / (1 - x).

Original entry on oeis.org

1, 1, 0, 1, 3, 4, 6, 14, 28, 49, 95, 196, 386, 754, 1524, 3102, 6258, 12700, 26032, 53440, 109772, 226457, 468863, 972300, 2020274, 4208530, 8784556, 18365322, 38461110, 80682740, 169501696, 356579216, 751138916, 1584281062, 3345404514, 7072055268, 14965933024, 31702754496
Offset: 0

Views

Author

Ilya Gutkovskiy, Jul 21 2021

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 37; A[] = 0; Do[A[x] = 1 + x + x^3 A[x]^2/(1 - x) + O[x]^(nmax + 1) // Normal, nmax + 1]; CoefficientList[A[x], x]
    a[0] = a[1] = 1; a[2] = 0; a[n_] := a[n] = a[n - 1] + Sum[a[k] a[n - k - 3], {k, 0, n - 3}]; Table[a[n], {n, 0, 37}]
    CoefficientList[Series[(1 - x)*(1 - Sqrt[(1 - x - 4*x^3 - 4*x^4)/(1 - x)]) / (2*x^3), {x, 0, 40}], x] (* Vaclav Kotesovec, Sep 27 2023 *)

Formula

a(0) = a(1) = 1, a(2) = 0; a(n) = a(n-1) + Sum_{k=0..n-3} a(k) * a(n-k-3).
G.f.: (1-x)*(1 - sqrt((1 - x - 4*x^3 - 4*x^4)/(1-x))) / (2*x^3). - Vaclav Kotesovec, Sep 27 2023

A349047 G.f. A(x) satisfies: A(x) = 1 / (1 - x + x^3 * A(x)).

Original entry on oeis.org

1, 1, 1, 0, -2, -5, -7, -4, 10, 38, 70, 68, -40, -329, -767, -1012, -214, 2842, 8642, 14332, 10136, -21622, -96578, -196412, -213080, 96264, 1037344, 2608788, 3698996, 1121127, -10234567, -33425980, -58537486, -45735382, 83471346, 408899204, 871127040
Offset: 0

Views

Author

Ilya Gutkovskiy, Nov 06 2021

Keywords

Crossrefs

Programs

  • Mathematica
    nmax = 36; A[] = 0; Do[A[x] = 1/(1 - x + x^3 A[x]) + O[x]^(nmax + 1) // Normal,nmax + 1]; CoefficientList[A[x], x]
    a[0] = 1; a[n_] := a[n] = a[n - 1] - Sum[a[k] a[n - k - 3], {k, 0, n - 3}]; Table[a[n], {n, 0, 36}]
    Table[Sum[(-1)^k Binomial[n - k, 2 k] CatalanNumber[k], {k, 0, Floor[n/3]}], {n, 0, 36}]

Formula

G.f.: (-1 + x + sqrt((1 - x)^2 + 4*x^3)) / (2*x^3).
a(0) = 1; a(n) = a(n-1) - Sum_{k=0..n-3} a(k) * a(n-k-3).
a(n) = Sum_{k=0..floor(n/3)} (-1)^k * binomial(n-k,2*k) * Catalan(k).
a(n) = F([(1-n)/3, (2-n)/3, -n/3], [2, -n], -27), where F is the generalized hypergeometric function. - Stefano Spezia, Nov 07 2021

A276066 Triangle read by rows: T(n,k) is the number of bargraphs of semiperimeter n having a total of k double rises and double falls (n>=2,k>=0). A double rise (fall) in a bargraph is any pair of adjacent up (down) steps.

Original entry on oeis.org

1, 1, 0, 1, 1, 2, 1, 0, 1, 2, 4, 1, 4, 1, 0, 1, 4, 6, 8, 8, 1, 6, 1, 0, 1, 7, 14, 22, 12, 19, 12, 1, 8, 1, 0, 1, 13, 34, 43, 48, 55, 18, 35, 16, 1, 10, 1, 0, 1, 26, 72, 105, 148, 109, 116, 103, 24, 56, 20, 1, 12, 1, 0, 1, 52, 154, 276, 344, 347, 398, 205, 232, 166, 30, 82, 24, 1, 14, 1, 0, 1
Offset: 2

Views

Author

Emeric Deutsch and Sergi Elizalde, Aug 25 2016

Keywords

Comments

Number of entries in row n is 2n-3.
Sum of entries in row n = A082582(n).
T(n,0) = A023431(n-2) = A025246(n+1).
Sum(k*T(n,k),k>=0) = 2*A273714(n).

Examples

			Row 4 is 1,2,1,0,1 because the 5 (=A082582(4)) bargraphs of semiperimeter 4 correspond to the compositions [1,1,1], [1,2], [2,1], [2,2], [3] and the corresponding drawings show that they have a total of  0, 1, 1, 2, 4 double rises and double falls, respectively.
Triangle starts:
1;
1,0,1;
1,2,1,0,1;
2,4,1,4,1,0,1;
4,6,8,8,1,6,1,0,1.
		

Crossrefs

Programs

  • Maple
    eq := z*G^2-(1-z-t^2*z-2*t*z^2+t^2*z^2)*G+z^2 = 0: G := RootOf(eq, G): Gser := simplify(series(G, z = 0, 22)): for n from 2 to 20 do P[n] := sort(coeff(Gser, z, n)) end do: for n from 2 to 20 do seq(coeff(P[n], t, j), j = 0 .. 2*n-4) end do; # yields sequence in triangular form.
    # second Maple program:
    b:= proc(n, y, t) option remember; expand(`if`(n=0, (1-t)*
          z^(y-1), `if`(t<0, 0, b(n-1, y+1, 1)*`if`(t=1, z, 1))+
         `if`(t>0 or y<2, 0, b(n, y-1, -1)*`if`(t=-1, z, 1))+
         `if`(y<1, 0, b(n-1, y, 0))))
        end:
    T:= n->(p->seq(coeff(p, z, i), i=0..degree(p)))(b(n, 0$2)):
    seq(T(n), n=2..12);  # Alois P. Heinz, Aug 25 2016
  • Mathematica
    b[n_, y_, t_] := b[n, y, t] = Expand[If[n == 0, (1 - t)*z^(y - 1), If[t < 0, 0, b[n - 1, y + 1, 1]*If[t == 1, z, 1]] + If[t > 0 || y < 2, 0, b[n, y - 1, -1]*If[t == -1, z, 1]] + If[y < 1, 0, b[n - 1, y, 0]]]]; T[n_] := Function[p, Table[Coefficient[p, z, i], {i, 0, Exponent[p, z]}]][b[n, 0, 0]]; Table[T[n], {n, 2, 12}] // Flatten (* Jean-François Alcover, Dec 02 2016 after Alois P. Heinz *)

Formula

G.f.: G = G(t,z) satisfies zG^2 - (1-z - t^2*z - 2tz^2+t^2*z^2)G + z^2 = 0.
The g.f. B(t,s,z) of bargraphs, where t(s) marks double rises (falls) and z marks semiperimeter, satisfies zB^2 - (1-(1+ts)z +(ts- t-s)z^2)B + z^2 = 0.
Showing 1-10 of 15 results. Next