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-4 of 4 results.

A005572 Number of walks on cubic lattice starting and finishing on the xy plane and never going below it.

Original entry on oeis.org

1, 4, 17, 76, 354, 1704, 8421, 42508, 218318, 1137400, 5996938, 31940792, 171605956, 928931280, 5061593709, 27739833228, 152809506582, 845646470616, 4699126915422, 26209721959656, 146681521121244, 823429928805936
Offset: 0

Views

Author

Keywords

Comments

Also number of paths from (0,0) to (n,0) in an n X n grid using only Northeast, East and Southeast steps and the East steps come in four colors. - Emeric Deutsch, Nov 03 2002
Number of skew Dyck paths of semilength n+1 with the left steps coming in two colors. - David Scambler, Jun 21 2013
Number of 2-colored Schroeder paths from (0,0) to (2n+2,0) with no level steps H=(2,0) at an even level. There are two ways to color an H-step at an odd level. Example: a(1)=4 because we have UUDD, UHD (2 choices) and UDUD. - José Luis Ramírez Ramírez, Apr 27 2015

Examples

			a(3) = 76 = sum of top row terms of M^3; i.e., (37 + 29 + 9 + 1).
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Binomial transform of A002212. Sequence shifted right twice is A025228.

Programs

  • Maple
    a := n -> simplify(2^n*hypergeom([3/2, -n], [3], -2)):
    seq(a(n), n=0..21); # Peter Luschny, Feb 03 2015
    a := n -> simplify(GegenbauerC(n, -n-1, -2))/(n+1):
    seq(a(n), n=0..21); # Peter Luschny, May 09 2016
  • Mathematica
    RecurrenceTable[{a[0]==1,a[1]==4,a[n]==((2n+1)a[n-1]-3(n-1)a[n-2]) 4/(n+2)}, a[n],{n,30}] (* Harvey P. Dale, Oct 04 2011 *)
    a[n_]:=If[n==0,1,Coefficient[(1+4x+x^2)^(n+1),x^n]/(n+1)]
    Table[a[n],{n,0,40}] (* Emanuele Munarini, Apr 06 2012 *)
  • Maxima
    a(n):=coeff(expand((1+4*x+x^2)^(n+1)),x^n)/(n+1); makelist(a(n),n,0,12); /* Emanuele Munarini, Apr 06 2012 */
    
  • PARI
    a(n)=polcoeff((1-4*x-sqrt(1-8*x+12*x^2+x^3*O(x^n)))/2,n+2)
    
  • PARI
    { A005572(n) = sum(k=0,n\2, binomial(n,2*k) * binomial(2*k,k) * 4^(n-2*k) / (k+1) ) } /* Max Alekseyev, Feb 02 2015 */
    
  • PARI
    {a(n)=sum(k=0,n, binomial(n,k) * 2^(n-k) * binomial(2*k+2, k)/(k+1) )}
    for(n=0,30,print1(a(n),", ")) \\ Paul D. Hanna, Feb 02 2015
    
  • Sage
    def A005572(n):
        A108198 = lambda n,k: (-1)^k*catalan_number(k+1)*rising_factorial(-n,k)/factorial(k)
        return sum(A108198(n,k)*2^(n-k) for k in (0..n))
    [A005572(n) for n in range(22)] # Peter Luschny, Feb 05 2015

Formula

Generating function A(x) satisfies 1 + (xA)^2 = A - 4xA.
a(0) = 1 and, for n > 0, a(n) = 4a(n-1) + Sum_{i=1..n-1} a(i-1)*a(n-i-1). - John W. Layman, Jan 07 2000
G.f.: (1 - 4*x - sqrt(1 - 8*x + 12*x^2))/(2*x^2).
D-finite with recurrence: a(n) = ((2*n+1)*a(n-1) - 3*(n-1)*a(n-2))*4/(n+2), n > 0.
a(m+n) = Sum_{k>=0} A052179(m, k)*A052179(n, k) = A052179(m+n, 0). - Philippe Deléham, Sep 15 2005
a(n) = 4*a(n-1) + A052177(n-1) = A052179(n, 0) = 6*A005573(n)-A005573(n-1) = Sum_{j=0..floor(n/2)} 4^(n-2*j)*C(n, 2*j)*C(2*j, j)/(j+1). - Henry Bottomley, Aug 23 2001
a(n) = Sum_{k=0..n} A097610(n,k)*4^k. - Philippe Deléham, Dec 03 2009
Let A(x) be the g.f., then B(x) = 1 + x*A(x) = 1 + 1*x + 4*x^2 + 17*x^3 + ... = 1/(1-z/(1-z/(1-z/(...)))) where z=x/(1-2*x) (continued fraction); more generally B(x) = C(x/(1-2*x)) where C(x) is the g.f. for the Catalan numbers (A000108). - Joerg Arndt, Mar 18 2011
From Gary W. Adamson, Jul 21 2011: (Start)
a(n) = sum of top row terms of M^n, M = an infinite square production matrix as follows:
3, 1, 0, 0, ...
1, 3, 1, 0, ...
1, 1, 3, 1, ...
1, 1, 1, 3, ...
... (End)
a(n) ~ 3*6^(n+1/2)/(n^(3/2)*sqrt(Pi)). - Vaclav Kotesovec, Oct 05 2012
a(n) = Sum_{k=0..floor(n/2)} binomial(n,2*k) * binomial(2k,k) * 4^(n-2k) / (k+1). - Max Alekseyev, Feb 02 2015
From Paul D. Hanna, Feb 02 2015: (Start)
a(n) = Sum_{k=0..n} binomial(n,k) * 2^(n-k) * binomial(2*k+2, k)/(k+1).
a(n) = Sum_{k=0..n} binomial(n,k) * 2^(n-k) * A000108(k+1).
a(n) = [x^n] (1 + 4*x + x^2)^(n+1) / (n+1).
G.f.: (1/x) * Series_Reversion( x/(1 + 4*x + x^2) ). (End)
a(n) = 2^n*hypergeom([3/2, -n], [3], -2). - Peter Luschny, Feb 03 2015
a(n) = 4^n*hypergeom([-n/2, (1-n)/2], [2], 1/4). - Robert Israel, Feb 04 2015
a(n) = Sum_{k=0..n} A108198(n,k)*2^(n-k). - Peter Luschny, Feb 05 2015
a(n) = 2*(12^(n/2))*(n!/(n+2)!)*GegenbauerC(n, 3/2,2/sqrt(3)), where GegenbauerC are Gegenbauer polynomials in Maple notation. This is a consequence of Robert Israel's formula. - Karol A. Penson, Feb 20 2015
a(n) = (2^(n+1)*3^((n+1)/2)*P(n+1,1,2/sqrt(3)))/((n+1)*(n+2)) where P(n,u,x) are the associated Legendre polynomials of the first kind. - Peter Luschny, Feb 24 2015
a(n) = -6^(n+1)*sqrt(3)*Integral{t=0..Pi}(cos(t)*(2+cos(t))^(-n-2))/(Pi*(n+2)). - Peter Luschny, Feb 24 2015
From Karol A. Penson and Wojciech Mlotkowski, Mar 16 2015: (Start)
Integral representation as the n-th moment of a positive function defined on a segment x=[2, 6]. This function is the Wigner's semicircle distribution shifted to the right by 4. This representation is unique. In Maple notation,
a(n) = int(x^n*sqrt(4-(x-4)^2)/(2*Pi), x=2..6),
a(n) = 2*6^n*Pochhammer(3/2, n)*hypergeom([-n, 3/2], [-n-1/2], 1/3)/(n+2)!
(End)
a(n) = GegenbauerC(n, -n-1, -2)/(n+1). - Peter Luschny, May 09 2016
E.g.f.: exp(4*x) * BesselI(1,2*x) / x. - Ilya Gutkovskiy, Jun 01 2020
From Peter Bala, Aug 18 2021: (Start)
G.f. A(x) = 1/(1 - 2*x)*c(x/(1 - 2*x))^2, where c(x) = (1 - sqrt(1 - 4*x))/(2*x) is the g.f. of the Catalan numbers A000108. Cf. A129400.
Conjecture: a(n) is even except for n of the form 2*(2^k - 1). [added Feb 03: the conjecture follows from the formula a(n) = Sum_{k = 0..n} 2^(n-k)*binomial(n, k)*Catalan(k+1) given above.] (End)
From Peter Bala, Feb 03 2024: (Start)
G.f.: 1/(1 - 2*x) * c(x/(1 - 2*x))^2 = 1/(1 - 6*x) * c(-x/(1 - 6*x))^2, where c(x) = (1 - sqrt(1 - 4*x))/(2*x) is the g.f. of the Catalan numbers A000108.
a(n) = 6^n * Sum_{k = 0..n} (-6)^(-k)*binomial(n, k)*Catalan(k+1).
a(n) = 6^n * hypergeom([-n, 3/2], [3], 2/3). (End)

Extensions

Additional comments from Michael Somos, Jun 10 2000

A254632 Triangle read by rows, T(n, k) = 4^n*[x^k]hypergeometric([3/2, -n], [3], -x), n>=0, 0<=k<=n.

Original entry on oeis.org

1, 4, 2, 16, 16, 5, 64, 96, 60, 14, 256, 512, 480, 224, 42, 1024, 2560, 3200, 2240, 840, 132, 4096, 12288, 19200, 17920, 10080, 3168, 429, 16384, 57344, 107520, 125440, 94080, 44352, 12012, 1430, 65536, 262144, 573440, 802816, 752640, 473088, 192192, 45760, 4862
Offset: 0

Views

Author

Peter Luschny, Feb 03 2015

Keywords

Examples

			[   1]
[   4,     2]
[  16,    16,     5]
[  64,    96,    60,    14]
[ 256,   512,   480,   224,    42]
[1024,  2560,  3200,  2240,   840,  132]
[4096, 12288, 19200, 17920, 10080, 3168, 429]
		

Crossrefs

Programs

  • Maple
    h := n -> simplify(hypergeom([3/2, -n], [3], -x)):
    seq(print(seq(4^n*coeff(h(n), x, k), k=0..n)), n=0..9);
  • Mathematica
    T[n_, k_] := 4^(n-k) Binomial[n, k] CatalanNumber[k+1];
    Table[T[n, k], {n, 0, 8}, {k, 0, n}] (* Jean-François Alcover, Jun 28 2019 *)
  • Sage
    A254632 = lambda n,k: (4)^(n-k)*binomial(n,k)*catalan_number(k+1)
    for n in range(7): [A254632(n,k) for k in (0..n)]

Formula

T(n,0) = A000302(n).
T(n,n) = A000108(n+1).
T(n,1) = A002699(n) for n>=1.
T(n,n-1) = A128650(n+2) for n>=1.
T(2*n,n) = A254633(n).
T(n,k) = 4^(n-k)*C(n,k)*Catalan(k+1).
sum(k=0..n, T(n,k)) = A025230(n+2).

A126181 Triangle read by rows, T(n,k) = C(n,k)*Catalan(n-k+1), n >= 0, 0 <= k <= n.

Original entry on oeis.org

1, 2, 1, 5, 4, 1, 14, 15, 6, 1, 42, 56, 30, 8, 1, 132, 210, 140, 50, 10, 1, 429, 792, 630, 280, 75, 12, 1, 1430, 3003, 2772, 1470, 490, 105, 14, 1, 4862, 11440, 12012, 7392, 2940, 784, 140, 16, 1, 16796, 43758, 51480, 36036, 16632, 5292, 1176, 180, 18, 1, 58786
Offset: 0

Views

Author

Emeric Deutsch, Dec 19 2006, Mar 30 2007

Keywords

Comments

T(n,k) is the number of hex trees with n edges and k nodes having median children (i.e., k vertical edges; 0 <= k <= n). A hex tree is a rooted tree where each vertex has 0, 1, or 2 children and, when only one child is present, it is either a left child, or a median child, or a right child (name due to an obvious bijection with certain tree-like polyhexes; see the Harary-Read paper).
Also, with offset 1, triangle read by rows: T(n,k) is the number of skew Dyck paths of semilength n and having k left steps (n >= 1; 0 <= k <= n-1). A skew Dyck path is a path in the first quadrant which begins at the origin, ends on the x-axis, consists of steps U=(1,1)(up), D=(1,-1)(down) and L=(-1,-1)(left) so that up and left steps do not overlap. The length of a path is defined to be the number of its steps. For example, T(4,2)=6 because we have UDUUUDLL, UUUUDLLD, UUDUUDLL, UUUUDLDL, UUUDUDLL and UUUUDDLL.
Also, with offset 1, number of skew Dyck paths of semilength and having k UDU's. Example: T(3,1)=4 because we have (UDU)UDD, (UDU)UDL, U(UDU)DD and U(UDU)DL (the UDU's are shown between parentheses).

Examples

			Triangle starts:
   1;
   2,  1;
   5,  4,  1;
  14, 15,  6,  1;
  42, 56, 30,  8,  1;
		

Crossrefs

Mirror image of A108198.

Programs

  • Maple
    c:=n->binomial(2*n,n)/(n+1): T:=proc(n,k) if k<=n then binomial(n,k)*c(n-k+1) else 0 fi end: for n from 0 to 10 do seq(T(n,k),k=1..n) od; # yields sequence in triangular form
    # Second implementation:
    h := n -> simplify(hypergeom([3/2,-n],[3],-x)):
    T := (n,k) -> 4^(n-k)*coeff(h(n), x, n-k):
    seq(print(seq(T(n,k), k=0..n)), n=0..9); # Peter Luschny, Feb 04 2015
  • Mathematica
    T[n_, k_] := Binomial[n, k]*CatalanNumber[n-k+1]; Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Feb 04 2015 *)

Formula

T(n,k) = binomial(n,k)*c(n-k+1), where c(m) = binomial(2m,m)/(m+1) is a Catalan number (A000108). Proof: There are c(n-k+1) binary trees with n-k edges. We can insert k vertical edges at the n-k+1 vertices (repetitions possible) in binomial(n-k+1+k-1,k) = binomial(n,k) ways.
G.f.: G = G(t,z) satisfies G = 1 + (2+t)*z*G + z^2*G^2.
Sum of terms in row n is A002212(n+1).
T(n,0) = A000108(n+1) (the Catalan numbers).
Sum_{k=0..n} k*T(n,k) = A026376(n) for n >= 1.
1/(1 - xy - 2x - x^2/(1 - xy - 2x - x^2/(1 - xy - 2x - x^2/(1 - xy - 2x - x^2/(1 - ... (continued fraction). - Paul Barry, Jan 28 2009
T(n,k) = 4^(n-k)*[x^(n-k)]hypergeom([3/2,-n],[3],-x). - Peter Luschny, Feb 04 2015

Extensions

Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, Jun 13 2007
Edited and previous name moved to comments by Peter Luschny, Feb 03 2015

A129159 Triangle read by rows: T(n,k) is the number of skew Dyck paths of semilength n and having abscissa of the first return to the x-axis equal to 2k (1 <= k <= n).

Original entry on oeis.org

1, 2, 1, 4, 4, 2, 11, 9, 11, 5, 37, 21, 31, 34, 14, 138, 59, 76, 116, 112, 42, 544, 198, 198, 315, 448, 384, 132, 2220, 743, 599, 825, 1358, 1758, 1353, 429, 9286, 2964, 2091, 2345, 3724, 5922, 6963, 4862, 1430, 39588, 12251, 8026, 7604, 10388, 17304, 25872
Offset: 1

Views

Author

Emeric Deutsch, Apr 03 2007

Keywords

Comments

A skew Dyck path is a path in the first quadrant which begins at the origin, ends on the x-axis, consists of steps U=(1,1)(up), D=(1,-1)(down) and L=(-1,-1)(left) so that up and left steps do not overlap. The length of the path is defined to be the number of its steps.
Row sums yield A002212.
T(n,1) = 1 + A002212(n-1) (indeed, the path U^nDL^(n-1) and the paths UDP, where P is a skew Dyck path of semilength n-1).
T(n,n) = binomial(2n-2,n-1)/n = A000108(n-1) (the Catalan numbers).

Examples

			T(3,2)=4 because we have UUDDUD, UUUDLD, UUDUDL and UUUDDL.
Triangle starts:
   1;
   2,  1;
   4,  4,  2;
  11,  9, 11,  5;
  37, 21, 31, 34, 14;
		

Crossrefs

Programs

  • Maple
    g:=(1-z-sqrt(1-6*z+5*z^2))/2/z: h:=(1-z-sqrt(z^2-2*z+1+4*t*z^2-4*t*z))/2/t/z: G:=t*z*h*g+z*(h-1): Gser:=simplify(series(G,z=0,14)): for n from 1 to 11 do P[n]:=sort(expand(coeff(Gser,z,n))) od: for n from 1 to 11 do seq(coeff(P[n],t,j),j=1..n) od; # yields sequence in triangular form

Formula

Sum_{k=1..n} k*T(n,k) = A129160(n).
G.f.: tzhg + z(h-1), where g = 1 + zg^2 + z(g-1) = (1 - z - sqrt(1 - 6z + 5z^2)) and h = 1 + tzh^2 + z(h-1) (h = h(t,z) is the g.f. for skew Dyck paths according to the semi-abscissa of the last point on the x-axis and semilength; see A108198).
Showing 1-4 of 4 results.