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.

A009766 Catalan's triangle T(n,k) (read by rows): each term is the sum of the entries above and to the left, i.e., T(n,k) = Sum_{j=0..k} T(n-1,j).

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 3, 5, 5, 1, 4, 9, 14, 14, 1, 5, 14, 28, 42, 42, 1, 6, 20, 48, 90, 132, 132, 1, 7, 27, 75, 165, 297, 429, 429, 1, 8, 35, 110, 275, 572, 1001, 1430, 1430, 1, 9, 44, 154, 429, 1001, 2002, 3432, 4862, 4862, 1, 10, 54, 208, 637, 1638, 3640, 7072, 11934
Offset: 0

Views

Author

Keywords

Comments

The entries in this triangle (in its many forms) are often called ballot numbers.
T(n,k) = number of standard tableaux of shape (n,k) (n > 0, 0 <= k <= n). Example: T(3,1) = 3 because we have 134/2, 124/3 and 123/4. - Emeric Deutsch, May 18 2004
T(n,k) is the number of full binary trees with n+1 internal nodes and jump-length k. In the preorder traversal of a full binary tree, any transition from a node at a deeper level to a node on a strictly higher level is called a jump; the positive difference of the levels is called the jump distance; the sum of the jump distances in a given ordered tree is called the jump-length. - Emeric Deutsch, Jan 18 2007
The k-th diagonal from the right (k=1, 2, ...) gives the sequence obtained by asking in how many ways can we toss a fair coin until we first get k more heads than tails. The k-th diagonal has formula k(2m+k-1)!/(m!(m+k)!) and g.f. (C(x))^k where C(x) is the generating function for the Catalan numbers, (1-sqrt(1-4*x))/(2*x). - Anthony C Robin, Jul 12 2007
T(n,k) is also the number of order-decreasing and order-preserving full transformations (of an n-element chain) of waist k (waist (alpha) = max(Im(alpha))). - Abdullahi Umar, Aug 25 2008
Formatted as an upper right triangle (see tables) a(c,r) is the number of different triangulated planar polygons with c+2 vertices, with triangle degree c-r+1 for the same vertex X (c=column number, r=row number, with c >= r >= 1). - Patrick Labarque, Jul 28 2010
The triangle sums, see A180662 for their definitions, link Catalan's triangle, its mirror is A033184, with several sequences, see crossrefs. - Johannes W. Meijer, Sep 22 2010
The m-th row of Catalan's triangle consists of the unique nonnegative differences of the form binomial(m+k,m)-binomial(m+k,m+1) with 0 <= k <= m (See Links). - R. J. Cano, Jul 22 2014
T(n,k) is also the number of nondecreasing parking functions of length n+1 whose maximum element is k+1. For example T(3,2) = 5 because we have (1,1,1,3), (1,1,2,3), (1,2,2,3), (1,1,3,3), (1,2,3,3). - Ran Pan, Nov 16 2015
T(n,k) is the number of Dyck paths from (0,0) to (n+2,n+2) which start with n-k+2 east steps and touch the diagonal y=x only on the last north step. - Felipe Rueda, Sep 18 2019
T(n-1,k) for k < n is number of well-formed strings of n parenthesis pairs with prefix of exactly n-k opening parenthesis; T(n,n) = T(n,n-1). - Hermann Stamm-Wilbrandt, May 02 2021

Examples

			Triangle begins in row n=0 with 0 <= k <= n:
  1;
  1, 1;
  1, 2,  2;
  1, 3,  5,   5;
  1, 4,  9,  14,  14;
  1, 5, 14,  28,  42,   42;
  1, 6, 20,  48,  90,  132,  132;
  1, 7, 27,  75, 165,  297,  429,  429;
  1, 8, 35, 110, 275,  572, 1001, 1430, 1430;
  1, 9, 44, 154, 429, 1001, 2002, 3432, 4862, 4862;
		

References

  • William Feller, Introduction to Probability Theory and its Applications, vol. I, ed. 2, chap. 3, sect. 1,2.
  • Ki Hang Kim, Douglas G. Rogers, and Fred W. Roush, Similarity relations and semiorders. Proceedings of the Tenth Southeastern Conference on Combinatorics, Graph Theory and Computing (Florida Atlantic Univ., Boca Raton, Fla., 1979), pp. 577-594, Congress. Numer., XXIII-XXIV, Utilitas Math., Winnipeg, Man., 1979. MR0561081 (81i:05013).
  • D. E. Knuth, TAOCP, Vol. 4, Section 7.2.1.6, Eq. 22, p. 451.
  • C. Krishnamachary and M. Bheemasena Rao, Determinants whose elements are Eulerian, prepared Bernoullian and other numbers, J. Indian Math. Soc., 14 (1922), 55-62, 122-138 and 143-146.
  • M. Bellon, Query 5467, L'Intermédiaire des Mathématiciens, 4 (1925), 11; H. Ory, 4 (1925), 120. - N. J. A. Sloane, Mar 09 2022
  • Andrzej Proskurowski and Ekaputra Laiman, Fast enumeration, ranking, and unranking of binary trees. Proceedings of the thirteenth Southeastern conference on combinatorics, graph theory and computing (Boca Raton, Fla., 1982). Congr. Numer. 35 (1982), 401-413.MR0725898 (85a:68152).
  • M. Welsch, Note #371, L'Intermédiaire des Mathématiciens, 2 (1895), pp. 235-237. - N. J. A. Sloane, Mar 02 2022

Crossrefs

The following are all versions of (essentially) the same Catalan triangle: A009766, A008315, A028364, A030237, A047072, A053121, A059365, A062103, A099039, A106566, A130020, A140344.
Sums of the shallow diagonals give A001405, central binomial coefficients: 1=1, 1=1, 1+1=2, 1+2=3, 1+3+2=6, 1+4+5=10, 1+5+9+5=20, ...
Row sums as well as the sums of the squares of the shallow diagonals give Catalan numbers (A000108).
Reflected version of A033184.
Triangle sums (see the comments): A000108 (Row1), A000957 (Row2), A001405 (Kn11), A014495 (Kn12), A194124 (Kn13), A030238 (Kn21), A000984 (Kn4), A000958 (Fi2), A165407 (Ca1), A026726 (Ca4), A081696 (Ze2).

Programs

  • GAP
    Flat(List([0..10],n->List([0..n],m->Binomial(n+m,n)*(n-m+1)/(n+1)))); # Muniru A Asiru, Feb 18 2018
    
  • Haskell
    a009766 n k = a009766_tabl !! n !! k
    a009766_row n = a009766_tabl !! n
    a009766_tabl = iterate (\row -> scanl1 (+) (row ++ [0])) [1]
    -- Reinhard Zumkeller, Jul 12 2012
    
  • Magma
    [[Binomial(n+k,n)*(n-k+1)/(n+1): k in [0..n]]: n in [0..10]]; // G. C. Greubel, Mar 07 2019
    
  • Maple
    A009766 := proc(n,k) binomial(n+k,n)*(n-k+1)/(n+1); end proc:
    seq(seq(A009766(n,k), k=0..n), n=0..10); # R. J. Mathar, Dec 03 2010
  • Mathematica
    Flatten[NestList[Append[Accumulate[#], Last[Accumulate[#]]] &, {1}, 9]] (* Birkas Gyorgy, May 19 2012 *)
    T[n_, k_] := T[n, k] = Which[k == 0, 1, k>n, 0, True, T[n-1, k] + T[n, k-1] ]; Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Mar 07 2016 *)
  • PARI
    {T(n, k) = if( k<0 || k>n, 0, binomial(n+1+k, k) * (n+1-k) / (n+1+k) )}; /* Michael Somos, Oct 17 2006 */
    
  • PARI
    b009766=(n1=0,n2=100)->{my(q=if(!n1,0,binomial(n1+1,2)));for(w=n1,n2,for(k=0,w,write("b009766.txt",1*q" "1*(binomial(w+k,w)-binomial(w+k,w+1)));q++))} \\ R. J. Cano, Jul 22 2014
    
  • Python
    from math import comb, isqrt
    def A009766(n): return comb((a:=(m:=isqrt(k:=n+1<<1))-(k<=m*(m+1)))+(b:=n-comb(a+1,2)),b)*(a-b+1)//(a+1) # Chai Wah Wu, Nov 12 2024
  • Sage
    @CachedFunction
    def ballot(p,q):
        if p == 0 and q == 0: return 1
        if p < 0 or p > q: return 0
        S = ballot(p-2, q) + ballot(p, q-2)
        if q % 2 == 1: S += ballot(p-1, q-1)
        return S
    A009766 = lambda n, k: ballot(2*k, 2*n)
    for n in (0..7): [A009766(n, k) for k in (0..n)]  # Peter Luschny, Mar 05 2014
    
  • Sage
    [[binomial(n+k,n)*(n-k+1)/(n+1) for k in (0..n)] for n in (0..10)] # G. C. Greubel, Mar 07 2019
    

Formula

T(n, m) = binomial(n+m, n)*(n-m+1)/(n+1), 0 <= m <= n.
G.f. for column m: (x^m)*N(2; m-1, x)/(1-x)^(m+1), m >= 0, with the row polynomials from triangle A062991 and N(2; -1, x) := 1.
G.f.: C(t*x)/(1-x*C(t*x)) = 1 + (1+t)*x + (1+2*t+2*t^2)*x^2 + ..., where C(x) = (1-sqrt(1-4*x))/(2*x) is the Catalan function. - Emeric Deutsch, May 18 2004
Another version of triangle T(n, k) given by [1, 0, 0, 0, 0, 0, ...] DELTA [0, 1, 1, 1, 1, 1, 1, ...] = 1; 1, 0; 1, 1, 0; 1, 2, 2, 0; 1, 3, 5, 5, 0; 1, 4, 9, 14, 14, 0; ... where DELTA is the operator defined in A084938. - Philippe Deléham, Feb 16 2005
O.g.f. (with offset 1) is the series reversion of x*(1+x*(1-t))/(1+x)^2 = x - x^2*(1+t) + x^3*(1+2*t) - x^4*(1+3*t) + ... . - Peter Bala, Jul 15 2012
Sum_{k=0..floor(n/2)} T(n-k+p-1, k+p-1) = A001405(n+2*p-2) - C(n+2*p-2, p-2), p >= 1. - Johannes W. Meijer, Oct 03 2013
Let A(x,t) denote the o.g.f. Then 1 + x*d/dx(A(x,t))/A(x,t) = 1 + (1 + t)*x + (1 + 2*t + 3*t^2)*x^2 + (1 + 3*t + 6*t^2 + 10*t^3)*x^3 + ... is the o.g.f. for A059481. - Peter Bala, Jul 21 2015
The n-th row polynomial equals the n-th degree Taylor polynomial of the function (1 - 2*x)/(1 - x)^(n+2) about 0. For example, for n = 4, (1 - 2*x)/(1 - x)^6 = 1 + 4*x + 9*x^2 + 14*x^3 + 14*x^4 + O(x^5). - Peter Bala, Feb 18 2018
T(n,k) = binomial(n + k + 1, k) - 2*binomial(n + k, k - 1), for 0 <= k <= n. - David Callan, Jun 15 2022

A056520 a(n) = (n + 2)*(2*n^2 - n + 3)/6.

Original entry on oeis.org

1, 2, 6, 15, 31, 56, 92, 141, 205, 286, 386, 507, 651, 820, 1016, 1241, 1497, 1786, 2110, 2471, 2871, 3312, 3796, 4325, 4901, 5526, 6202, 6931, 7715, 8556, 9456, 10417, 11441, 12530, 13686, 14911, 16207, 17576, 19020, 20541, 22141, 23822
Offset: 0

Views

Author

N. J. A. Sloane, Laura Kasavan (maui12129(AT)cswebmail.com), Aug 26 2000

Keywords

Comments

Hankel transform of A030238. - Paul Barry, Oct 16 2007
Equals (1, 2, 3, 4, 5, ...) convolved with (1, 0, 3, 5, 7, 9, ...). - Gary W. Adamson, Jul 31 2010
a(n) equals n!^2 times the determinant of the n X n matrix whose (i,j)-entry is 1 + KroneckerDelta[i, j] (-1 + (1 + i^2)/i^2). - John M. Campbell, May 20 2011
Positions of ones in A253903 (with offset 1). - Harvey P. Dale, Mar 05 2015

Crossrefs

Programs

Formula

a(n) = a(n-1) + n^2.
a(n) = A000330(n) + 1.
G.f.: (1 - 2*x + 4*x^2 - x^3)/(1 - x)^4. - Paul Barry, Apr 14 2010
Let b(0) = b(1) = 1, b(n) = max(b(n-1) + (n - 1)^2, b(n-2) + (n - 2)^2) for n >= 2; then a(n) = b(n+1). - Yalcin Aktar, Jul 28 2011

A099039 Riordan array (1,c(-x)), where c(x) = g.f. of Catalan numbers.

Original entry on oeis.org

1, 0, 1, 0, -1, 1, 0, 2, -2, 1, 0, -5, 5, -3, 1, 0, 14, -14, 9, -4, 1, 0, -42, 42, -28, 14, -5, 1, 0, 132, -132, 90, -48, 20, -6, 1, 0, -429, 429, -297, 165, -75, 27, -7, 1, 0, 1430, -1430, 1001, -572, 275, -110, 35, -8, 1, 0, -4862, 4862, -3432, 2002, -1001, 429, -154, 44, -9, 1, 0, 16796, -16796, 11934, -7072, 3640, -1638
Offset: 0

Views

Author

Paul Barry, Sep 23 2004

Keywords

Comments

Row sums are generalized Catalan numbers A064310. Diagonal sums are 0^n+(-1)^n*A030238(n-2). Inverse is A026729, as number triangle. Columns have g.f. (xc(-x))^k=((sqrt(1+4x)-1)/2)^k.
Triangle T(n,k), 0 <= k <= n, read by rows, given by [0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, ... ] DELTA [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, ... ] where DELTA is the operator defined in A084938. - Philippe Deléham, May 31 2005

Examples

			Rows begin {1}, {0,1}, {0,-1,1}, {0,2,-2,1}, {0,-5,5,-3,1}, ...
Triangle begins
  1;
  0,    1;
  0,   -1,    1;
  0,    2,   -2,   1;
  0,   -5,    5,  -3,    1;
  0,   14,  -14,   9,   -4,   1;
  0,  -42,   42, -28,   14,  -5,  1;
  0,  132, -132,  90,  -48,  20, -6,  1;
  0, -429,  429, -297, 165, -75, 27, -7, 1;
Production matrix is
  0,  1,
  0, -1,  1,
  0,  1, -1,  1,
  0, -1,  1, -1,  1,
  0,  1, -1,  1, -1,  1,
  0, -1,  1, -1,  1, -1,  1,
  0,  1, -1,  1, -1,  1, -1,  1,
  0, -1,  1, -1,  1, -1,  1, -1,  1,
  0,  1, -1,  1, -1,  1, -1,  1, -1,  1
		

Crossrefs

The three triangles A059365, A106566 and A099039 are the same except for signs and the leading term.
Cf. A106566 (unsigned version), A059365
The following are all versions of (essentially) the same Catalan triangle: A009766, A030237, A033184, A059365, A099039, A106566, A130020, A047072.

Programs

  • Mathematica
    T[n_, k_]:= If[n == 0 && k == 0, 1, If[n == 0 && k > 0, 0, (-1)^(n + k)*Binomial[2*n - k - 1, n - k]*k/n]];  Table[T[n, k], {n, 0, 15}, {k, 0, n}] // Flatten (* G. C. Greubel, Dec 31 2017 *)
  • PARI
    {T(n,k) = if(n == 0 && k == 0, 1, if(n == 0 && k > 0, 0, (-1)^(n + k)*binomial(2*n - k - 1, n - k)*k/n))};
    for(n=0,15, for(k=0,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Dec 31 2017

Formula

T(n, k) = (-1)^(n+k)*binomial(2*n-k-1, n-k)*k/n for 0 <= k <= n with n > 0; T(0, 0) = 1; T(0, k) = 0 if k > 0. - Philippe Deléham, May 31 2005

A132364 Expansion of 1/(1-x^2*c(x)), c(x) the g.f. of A000108.

Original entry on oeis.org

1, 0, 1, 1, 3, 7, 20, 59, 184, 593, 1964, 6642, 22845, 79667, 281037, 1001092, 3595865, 13009673, 47366251, 173415176, 638044203, 2357941142, 8748646386, 32576869203, 121701491701, 456012458965, 1713339737086
Offset: 0

Views

Author

Philippe Deléham, Nov 08 2007

Keywords

Comments

Diagonal sums of A106566.

Crossrefs

Programs

  • Mathematica
    a[0] := 1; a[n_] := Sum[(k/(n - k))*Binomial[2*n - 3*k - 1, n - 2*k], {k, 0, Floor[n/2]}]; Table[a[n], {n,0,25}] (* G. C. Greubel, Oct 19 2016 *)
  • PARI
    c(x) = (1 - sqrt(1 - 4*x)) / (2*x); \\ A000108
    my(x='x+O('x^30)); Vec(1/(1-x^2*c(x))) \\ Michel Marcus, Nov 13 2022

Formula

a(0)=1, a(n) = Sum_{k=0..floor(n/2)} (k/(n-k))*C(2*n-3*k-1,n-2*k), n>0.
G.f.: (2-x-x*sqrt(1-4*x))/(2-2*x+2*x^3). - Philippe Deléham, Feb 24 2013
Conjecture: +(-n+1)*a(n) +(5*n-11)*a(n-1) +2*(-2*n+5)*a(n-2) +(-n+1)*a(n-3) +2*(2*n-5)*a(n-4)=0. - R. J. Mathar, Aug 28 2015
a(n) ~ 2^(2*n + 2) / (49 * sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Nov 13 2022

Extensions

Typo in a(n) term corrected Johannes W. Meijer, Sep 13 2010

A127158 Triangle read by rows: T(n,k) is the number of ordered trees with n edges and having k branches of length 1 starting from the root (0<=k<=n).

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 1, 3, 0, 1, 3, 5, 5, 0, 1, 7, 18, 9, 7, 0, 1, 20, 52, 37, 13, 9, 0, 1, 59, 168, 113, 60, 17, 11, 0, 1, 184, 546, 388, 190, 87, 21, 13, 0, 1, 593, 1826, 1313, 688, 283, 118, 25, 15, 0, 1, 1964, 6211, 4545, 2408, 1076, 392, 153, 29, 17, 0, 1, 6642, 21459
Offset: 0

Views

Author

Emeric Deutsch, Mar 01 2007

Keywords

Comments

Row sums are the Catalan numbers (A000108). T(n,0)=A030238(n-2) for n>=2. Sum(k*T(n,k),k=0..n)=A026012(n-1) for n>=1.

Examples

			Triangle starts:
1;
0,1;
1,0,1;
1,3,0,1;
3,5,5,0,1;
7,18,9,7,0,1;
		

Crossrefs

Programs

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

Formula

G.f.= 1/(1-tzC+tz^2*C-z^2*C), where C=[1-sqrt(1-4z)]/(2z) is the Catalan function.

A319636 a(n) = Sum_{k=1..n} binomial(2*n - 3*k + 1, n - k)*k/(n - k + 1).

Original entry on oeis.org

0, 1, 3, 6, 11, 23, 60, 182, 589, 1960, 6641, 22849, 79676, 281048, 1001100, 3595865, 13009663, 47366234, 173415160, 638044198, 2357941155, 8748646416, 32576869239, 121701491725, 456012458960, 1713339737046, 6453584646774, 24364925259967, 92185136438926, 349479503542513
Offset: 0

Views

Author

Vladimir Kruchinin, Sep 25 2018

Keywords

Crossrefs

Programs

  • GAP
    List([0..30], n-> Sum([1..n], k-> Binomial(2*n-3*k+1,n-k)*k/(n-k+1))); # Muniru A Asiru, Sep 25 2018
  • Maple
    a:=n->add(binomial(2*n-3*k+1,n-k)*k/(n-k+1),k=1..n): seq(a(n),n=0..30); # Muniru A Asiru, Sep 25 2018
  • Mathematica
    a[n_] := Sum[Binomial[2 n-3 k + 1, n - k] k/(n - k + 1), {k, 1, n}]; Array[a, 50] (* or *) CoefficientList[Series[(1 - Sqrt[1 - 4 x])/(Sqrt[1 - 4 x] (x^2 - x) + x^2 - 3 x + 2), {x, 0, 50}], x] (* Stefano Spezia, Sep 25 2018 *)
    RecurrenceTable[{n a[n] - (5 n - 6) a[n - 1] + 2 (2 n - 3) a[n - 2] + n a[n - 3] - 2 (2 n - 3) a[n - 4] + 3 (n - 2) == 0, a[0] == 0, a[1] == 1, a[2] == 3, a[3] == 6}, a, {n, 0, 30}] (* Bruno Berselli, Sep 26 2018 *)
  • Maxima
    a(n):=sum(binomial(2*n-3*k+1,n-k)*k/(n-k+1),k,1,n);
    
  • PARI
    x='x+O('x^40); concat(0, Vec((1-sqrt(1-4*x))/(sqrt(1-4*x)*(x^2-x)+x^2-3*x+2))) \\ Altug Alkan, Sep 25 2018
    

Formula

G.f.: (1 - sqrt(1 - 4*x))/(sqrt(1 - 4*x)*(x^2 - x) + x^2 - 3*x + 2).
a(n) ~ 2^(2*n + 4) / (49 * sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Sep 26 2018
D-finite with recurrence: n*a(n) - (5*n - 6)*a(n-1) + 2*(2*n - 3)*a(n-2) + n*a(n-3) - 2*(2*n - 3)*a(n-4) + 3*(n - 2) = 0 for n > 3. - Bruno Berselli, Sep 26 2018
Showing 1-6 of 6 results.