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

A000245 a(n) = 3*(2*n)!/((n+2)!*(n-1)!).

Original entry on oeis.org

0, 1, 3, 9, 28, 90, 297, 1001, 3432, 11934, 41990, 149226, 534888, 1931540, 7020405, 25662825, 94287120, 347993910, 1289624490, 4796857230, 17902146600, 67016296620, 251577050010, 946844533674, 3572042254128, 13505406670700, 51166197843852, 194214400834356
Offset: 0

Views

Author

Keywords

Comments

This sequence represents the expected saturation of a binary search tree (or BST) on n nodes times the number of binary search trees on n nodes, or alternatively, the sum of the saturation of all binary search trees on n nodes. - Marko Riedel, Jan 24 2002
1->12, 2->123, 3->1234 etc. starting with 1, gives A007001: 1, 12, 12123, 12123121231234... summing the digits gives this sequence. - Miklos Kristof, Nov 05 2002
a(n-1) = number of n-th generation vertices in the tree of sequences with unit increase labeled by 2 (cf. Zoran Sunic reference). - Benoit Cloitre, Oct 07 2003
With offset 1, number of permutations beginning with 12 and avoiding 32-1.
Number of lattice paths from (0,0) to (n,n) with steps E=(1,0) and N=(0,1) which touch but do not cross the line x-y=1. - Herbert Kociemba, May 24 2004
a(n) is the number of Dyck (n+1)-paths that start with UU. For example, a(2)=3 counts UUUDDD, UUDUDD, UUDDUD. - David Callan, Dec 08 2004
a(n) is the number of Dyck (n+2)-paths that start with UUDU. For example, a(2)=3 counts UUDUDDUD, UUDUDUDD, UUDUUDDD. - David Scambler, Feb 14 2011
Hankel transform is (0,-1,-1,0,1,1,0,-1,-1,0,...). Hankel transform of a(n+1) is (1,0,-1,-1,0,1,1,0,-1,-1,0,...). - Paul Barry, Feb 08 2008
Starting with offset 1 = row sums of triangle A154558. - Gary W. Adamson, Jan 11 2009
Starting with offset 1 equals INVERT transform of A014137, partial sums of the Catalan numbers: (1, 2, 4, 9, 23, ...). - Gary W. Adamson, May 15 2009
With offset 1, a(n) is the binomial transform of the shortened Motzkin numbers: 1, 2, 4, 9, 21, 51, 127, 323, ... (A001006). - Aoife Hennessy (aoife.hennessy(AT)gmail.com), Sep 07 2009
The Catalan sequence convolved with its shifted variant, e.g. a(5) = 90 = (1, 1, 2, 5, 14) dot (42, 14, 5, 2, 1) = (42 + 14 + 10 + 10 + 14 ) = 90. - Gary W. Adamson, Nov 22 2011
a(n+2) = A214292(2*n+3,n). - Reinhard Zumkeller, Jul 12 2012
With offset 3, a(n) is the number of permutations on {1,2,...,n} that are 123-avoiding, i.e., do not contain a three term monotone subsequence, for which the first ascent is at positions (3,4); see Connolly link. There it is shown in general that the k-th Catalan Convolution is the number of 123-avoiding permutations for which the first ascent is at (k, k+1). (For n=k, the first ascent is defined to be at positions (k,k+1) if the permutation is the decreasing permutation with no ascents.) - Anant Godbole, Jan 17 2014
With offset 3, a(n)=number of permutations on {1,2,...,n} that are 123-avoiding and for which the integer n is in the 3rd spot; see Connolly link. For example, there are 297 123-avoiding permutations on n=9 at which the element 9 is in the third spot. - Anant Godbole, Jan 17 2014
With offset 1, a(n) is the number of North-East paths from (0,0) to (n+1,n+1) that bounce off y = x to the right exactly once but do not cross y = x vertically. Details can be found in Section 4.4 in Pan and Remmel's link. - Ran Pan, Feb 01 2016
The total number of returns (downsteps which end on the line y=0) within the set of all Dyck paths from (0,0) to (2n,0). - Cheyne Homberger, Sep 05 2016
a(n) is the number of intervals of the form [s,w] that are distributive (equivalently, modular) lattices in the weak order on S_n, for a fixed simple reflection s. - Bridget Tenner, Jan 16 2020
a(n+2) is the number of coalescent histories for a pair (G,S) where G is a gene tree with 3-pseudocaterpillar shape and n leaves, S is a species tree with caterpillar shape and n leaves, and G and S have identical leaf labeling. - Noah A Rosenberg, Jun 15 2022
a(n) is the number of parking functions of size n avoiding the patterns 132, 213, and 312. - Lara Pudwell, Apr 10 2023
a(n) is the number of parking functions of size n avoiding the patterns 123 and 213. - Lara Pudwell, Apr 10 2023

References

  • Pierre de la Harpe, Topics in Geometric Group Theory, Univ. Chicago Press, 2000, p. 11, coefficients of P_3(z).
  • 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)
  • C. Krishnamachary and M. Bheemasena Rao, Determinants whose elements are Eulerian, prepared Bernoullian and other numbers, J. Indian Math. Soc., Vol. 14 (1922), pp. 55-62, 122-138 and 143-146.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

First differences of Catalan numbers A000108.
T(n, n+3) for n=0, 1, 2, ..., array T as in A047072.
Cf. A099364.
A diagonal of any of the essentially equivalent arrays A009766, A030237, A033184, A059365, A099039, A106566, A130020, A047072.
Column k=1 of A067323.

Programs

  • GAP
    Concatenation([0],List([1..30],n->3*Factorial(2*n)/(Factorial(n+2)*Factorial(n-1)))); # Muniru A Asiru, Aug 09 2018
  • Magma
    [0] cat [3*Factorial(2*n)/(Factorial(n+2)*Factorial(n-1)): n in [1..30]]; // Vincenzo Librandi, Feb 15 2016
    
  • Maple
    A000245 := n -> 3*binomial(2*n, n-1)/(n+2);
    seq(A000245(n), n=0..27);
  • Mathematica
    Table[3(2n)!/((n+2)!(n-1)!),{n,0,30}] (* or *) Table[3*Binomial[2n,n-1]/(n+2),{n,0,30}] (* or *) Differences[CatalanNumber[Range[0,31]]] (* Harvey P. Dale, Jul 13 2011 *)
  • PARI
    a(n)=if(n<1,0,3*(2*n)!/(n+2)!/(n-1)!)
    
  • Sage
    [catalan_number(i+1) - catalan_number(i) for i in range(28)] # Zerinvary Lajos, May 17 2009
    
  • Sage
    def A000245_list(n) :
        D = [0]*(n+1); D[1] = 1
        b = False; h = 1; R = []
        for i in range(2*n-1) :
            if b :
                for k in range(h,0,-1) : D[k] += D[k-1]
                h += 1; R.append(D[2])
            else :
                for k in range(1,h, 1) : D[k] += D[k+1]
            b = not b
        return R
    A000245_list(29) # Peter Luschny, Jun 03 2012
    

Formula

a(n) = A000108(n+1) - A000108(n).
G.f.: x*(c(x))^3 = (-1+(1-x)*c(x))/x, c(x) = g.f. for Catalan numbers. Also a(n) = 3*n*Catalan(n)/(n+2). - Wolfdieter Lang
For n > 1, a(n) = 3a(n-1) + Sum[a(k)*a(n-k-2), k=1,...,n-3]. - John W. Layman, Dec 13 2002; proved by Michael Somos, Jul 05 2003
G.f. is A(x) = C(x)*(1-x)/x-1/x = x(1+x*C(x)^2)*C(x)^2 where C(x) is g.f. for Catalan numbers, A000108.
G.f. satisfies x^2*A(x)^2 + (3*x-1)*A(x) + x = 0.
Series reversion of g.f. A(x) is -A(-x). - Michael Somos, Jan 21 2004
a(n+1) = Sum_{i+j+k=n} C(i)C(j)C(k) with i, j, k >= 0 and where C(k) denotes the k-th Catalan number. - Benoit Cloitre, Nov 09 2003
An inverse Chebyshev transform of x^2. - Paul Barry, Oct 13 2004
The sequence is 0, 0, 1, 0, 3, 0, 9, 0, ... with zeros restored. Second binomial transform of (-1)^n*A005322(n). The g.f. is transformed to x^2 under the Chebyshev transformation A(x)->(1/(1+x^2))A(x/(1+x^2)). For a sequence b(n), this corresponds to taking Sum_{k=0..floor(n/2)} C(n-k, k)(-1)^k*b(n-2k), or Sum_{k=0..n} C((n+k)/2, k)*b(k)*(-1)^((n-k)/2)*(1+(-1)^(n-k))/2. - Paul Barry, Oct 13 2004
G.f.: (c(x^2)*(1-x^2)-1)/x^2, c(x) the g.f. of A000108; a(n) = Sum_{k=0..n} (k+1)*C(n, (n-k)/2)*(-1)^k*(C(2,k)-2*C(1,k)+C(0, k))*(1+(-1)^(n-k))/(n+k+2). - Paul Barry, Oct 13 2004
a(n) = Sum_{k=0..n} binomial(n,k)*2^(n-k)*(-1)^(k+1)*binomial(k, floor((k-1)/2)). - Paul Barry, Feb 16 2006
E.g.f.: exp(2*x)*(Bessel_I(1,2x) - Bessel_I(2,2*x)). - Paul Barry, Jun 04 2007
a(n) = (1/Pi)*Integral_{x=0..4} x^n*(x-1)*sqrt(x*(4-x))/(2*x). - Paul Barry, Feb 08 2008
D-finite with recurrence: For n > 1, a(n+1) = 2*(2n+1)*(n+1)*a(n)/((n+3)*n). - Sean A. Irvine, Dec 09 2009
Let A be the Toeplitz matrix of order n defined by: A[i,i-1]=-1, A[i,j] = Catalan(j-i), (i<=j), and A[i,j] = 0, otherwise. Then, for n >= 2, a(n-1) = (-1)^(n-2)*coeff(charpoly(A,x),x^2). - Milan Janjic, Jul 08 2010
a(n) = sum of top row terms of M^(n-1), M = an infinite square production matrix as follows:
2, 1, 0, 0, 0, 0, ...
1, 1, 1, 0, 0, 0, ...
1, 1, 1, 1, 0, 0, ...
1, 1, 1, 1, 1, 0, ...
1, 1, 1, 1, 1, 1, ...
...
- Gary W. Adamson, Jul 14 2011
E.g.f.: exp(2*x)*(BesselI(2,2*x)) = Q(0) - 1 where Q(k) = 1 - 2*x/(k + 1 - 3*((k+1)^2)/((k^2) + 8*k + 9 - (k+2)*((k+3)^2)*(2*k+3)/((k+3)*(2*k+3) - 3*(k+1)/Q(k+1)))); (continued fraction). - Sergei N. Gladkovskii, Dec 05 2011
a(n) = -binomial(2*n,n)/(n+1)*hypergeom([-1,n+1/2],[n+2],4). - Peter Luschny, Aug 15 2012
a(n) = Sum_{i=0..n-1} C(i)*C(n-i), where C(i) denotes the i-th Catalan number. - Dmitry Kruchinin, Mar 02 2013
a(n) = binomial(2*n-1, n) - binomial(2*n-1, n-3). - Johannes W. Meijer, Jul 31 2013
a(n) ~ 3*4^n/(n^(3/2)*sqrt(Pi)). - Vaclav Kotesovec, Feb 26 2016
a(n) = ((-1)^n/(n+1))*Sum_{i=0..n-1} (-1)^(i+1)*(n+1-i)*binomial(2*n+2,i), n>=0. - Taras Goy, Aug 09 2018
From Amiram Eldar, Jan 02 2022: (Start)
Sum_{n>=1} 1/a(n) = 14*Pi/(27*sqrt(3)) + 5/9.
Sum_{n>=1} (-1)^(n+1)/a(n) = 164*log(phi)/(75*sqrt(5)) + 7/25, where phi is the golden ratio (A001622). (End)
a(n) = 3*Sum_{k = 0..n-2} (-1)^k * binomial(2*n-k-1, n+1)*binomial(n+1, k)/(k + 1) for n >= 2. - Peter Bala, Sep 02 2024
a(n) = (3*n/(n+2))*A000108(n). - Taras Goy, Dec 20 2024

Extensions

I changed the description and added an initial 0, to make this coincide with the first differences of the Catalan numbers A000108. Some of the other lines will need to be changed as a result. - N. J. A. Sloane, Oct 31 2003

A064189 Triangle T(n,k), 0 <= k <= n, read by rows, defined by: T(0,0)=1, T(n,k)=0 if n < k, T(n,k) = T(n-1,k-1) + T(n-1,k) + T(n-1,k+1).

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 4, 5, 3, 1, 9, 12, 9, 4, 1, 21, 30, 25, 14, 5, 1, 51, 76, 69, 44, 20, 6, 1, 127, 196, 189, 133, 70, 27, 7, 1, 323, 512, 518, 392, 230, 104, 35, 8, 1, 835, 1353, 1422, 1140, 726, 369, 147, 44, 9, 1, 2188, 3610, 3915, 3288, 2235, 1242, 560, 200, 54, 10, 1
Offset: 0

Views

Author

N. J. A. Sloane, Sep 21 2001

Keywords

Comments

Motzkin triangle read in reverse order.
T(n,k) = number of lattice paths from (0,0) to (n,k), staying weakly above the x-axis and consisting of steps U=(1,1), D=(1,-1) and H=(1,0). Example: T(3,1) = 5 because we have HHU, UDU, HUH, UHH and UUD. Columns 0,1,2 and 3 give A001006 (Motzkin numbers), A002026 (first differences of Motzkin numbers), A005322 and A005323, respectively. - Emeric Deutsch, Feb 29 2004
Riordan array ((1-x-sqrt(1-2x-3x^2))/(2x^2), (1-x-sqrt(1-2x-3x^2))/(2x)). Inverse is the array (1/(1+x+x^2), x/(1+x+x^2)) (A104562). - Paul Barry, Mar 15 2005
Inverse binomial matrix applied to A039598. - Philippe Deléham, Feb 28 2007
Triangle T(n,k), 0 <= k <= n, read by rows given by: T(0,0)=1, T(n,k)=0 if k < 0 or if k > n, T(n,0) = T(n-1,0) + T(n-1,1), T(n,k) = T(n-1,k-1) + T(n-1,k) + T(n-1,k+1) for k >= 1. - Philippe Deléham, Mar 27 2007
This triangle belongs to the family of triangles defined by: T(0,0)=1, T(n,k)=0 if k < 0 or if k > n, T(n,0) = x*T(n-1,0) + T(n-1,1), T(n,k) = T(n-1,k-1) + y*T(n-1,k) + T(n-1,k+1) for k >= 1. Other triangles arise from choosing different values for (x,y): (0,0) -> A053121; (0,1) -> A089942; (0,2) -> A126093; (0,3) -> A126970; (1,0)-> A061554; (1,1) -> A064189; (1,2) -> A039599; (1,3) -> A110877; (1,4) -> A124576; (2,0) -> A126075; (2,1) -> A038622; (2,2) -> A039598; (2,3) -> A124733; (2,4) -> A124575; (3,0) -> A126953; (3,1) -> A126954; (3,2) -> A111418; (3,3) -> A091965; (3,4) -> A124574; (4,3) -> A126791; (4,4) -> A052179; (4,5) -> A126331; (5,5) -> A125906. - Philippe Deléham, Sep 25 2007
Equals binomial transform of triangle A053121. - Gary W. Adamson, Oct 25 2008
Consider a semi-infinite chessboard with squares labeled (n,k), ranks or rows n >= 0, files or columns k >= 0; the number of king-paths of length n from (0,0) to (n,k), 0 <= k <= n, is T(n,k). The recurrence relation given above relates to the movements of the king. This is essentially the comment made by Harrie Grondijs for the Motzkin triangle A026300. - Johannes W. Meijer, Oct 10 2010

Examples

			Triangle begins:
  [0]   1;
  [1]   1,    1;
  [2]   2,    2,    1;
  [3]   4,    5,    3,    1;
  [4]   9,   12,    9,    4,   1;
  [5]  21,   30,   25,   14,   5,   1;
  [6]  51,   76,   69,   44,  20,   6,   1;
  [7] 127,  196,  189,  133,  70,  27,   7,  1;
  [8] 323,  512,  518,  392, 230, 104,  35,  8, 1;
  [9] 835, 1353, 1422, 1140, 726, 369, 147, 44, 9, 1;
  ...
From _Philippe Deléham_, Nov 04 2011: (Start)
Production matrix begins:
  1, 1
  1, 1, 1
  0, 1, 1, 1
  0, 0, 1, 1, 1
  0, 0, 0, 1, 1, 1
  0, 0, 0, 0, 1, 1, 1 (End)
		

References

  • See A026300 for additional references and other information.

Crossrefs

A026300 (the main entry for this sequence) with rows reversed.
Row sums give: A005773(n+1) or A307789(n+2).

Programs

  • Maple
    alias(C=binomial): A064189 := (n,k) -> add(C(n,j)*(C(n-j,j+k)-C(n-j,j+k+2)), j=0..n): seq(seq(A064189(n,k), k=0..n),n=0..10); # Peter Luschny, Dec 31 2019
    # Uses function PMatrix from A357368. Adds a row above and a column to the left.
    PMatrix(10, n -> simplify(hypergeom([1 -n/2, -n/2+1/2], [2], 4))); # Peter Luschny, Oct 08 2022
  • Mathematica
    T[0, 0, x_, y_] := 1; T[n_, 0, x_, y_] := x*T[n - 1, 0, x, y] + T[n - 1, 1, x, y]; T[n_, k_, x_, y_] := T[n, k, x, y] = If[k < 0 || k > n, 0, T[n - 1, k - 1, x, y] + y*T[n - 1, k, x, y] + T[n - 1, k + 1, x, y]]; Table[T[n, k, 1, 1], {n, 0, 10}, {k, 0, n}] // Flatten (* G. C. Greubel, Apr 21 2017 *)
    T[n_, k_] := Binomial[n, k] Hypergeometric2F1[(k - n)/2, (k - n + 1)/2, k + 2, 4];
    Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten  (* Peter Luschny, May 19 2021 *)
  • PARI
    {T(n, k) = if( k<0 || k>n, 0, polcoeff( polcoeff( 2 / (1 - x + sqrt(1 - 2*x - 3*x^2) - 2*x*y) + x * O(x^n), n), k))}; /* Michael Somos, Jun 06 2016 */
  • Sage
    def A064189_triangel(dim):
        M = matrix(ZZ,dim,dim)
        for n in range(dim): M[n,n] = 1
        for n in (1..dim-1):
            for k in (0..n-1):
                M[n,k] = M[n-1,k-1]+M[n-1,k]+M[n-1,k+1]
        return M
    A064189_triangel(9) # Peter Luschny, Sep 20 2012
    

Formula

Sum_{k=0..n} T(n, k)*(k+1) = 3^n.
Sum_{k=0..n} T(n, k)*T(n, n-k) = T(2*n, n) - T(2*n, n+2)
G.f.: M/(1-t*z*M), where M = 1 + z*M + z^2*M^2 is the g.f. of the Motzkin numbers (A001006). - Emeric Deutsch, Feb 29 2004
Sum_{k>=0} T(m, k)*T(n, k) = A001006(m+n). - Philippe Deléham, Mar 05 2004
Sum_{k>=0} T(n-k, k) = A005043(n+2). - Philippe Deléham, May 31 2005
Column k has e.g.f. exp(x)*(BesselI(k,2*x)-BesselI(k+2,2*x)). - Paul Barry, Feb 16 2006
T(n,k) = Sum_{j=0..n} C(n,j)*(C(n-j,j+k) - C(n-j,j+k+2)). - Paul Barry, Feb 16 2006
n-th row is generated from M^n * V, where M = the infinite tridiagonal matrix with all 1's in the super, main and subdiagonals; and V = the infinite vector [1,0,0,0,...]. E.g., Row 3 = (4, 5, 3, 1), since M^3 * V = [4, 5, 3, 1, 0, 0, 0, ...]. - Gary W. Adamson, Nov 04 2006
T(n,k) = A122896(n+1,k+1). - Philippe Deléham, Apr 21 2007
T(n,k) = (k/n)*Sum_{j=0..n} binomial(n,j)*binomial(j,2*j-n-k). - Vladimir Kruchinin, Feb 12 2011
Sum_{k=0..n} T(n,k)*(-1)^k*(k+1) = (-1)^n. - Werner Schulte, Jul 08 2015
Sum_{k=0..n} T(n,k)*(k+1)^3 = (2*n+1)*3^n. - Werner Schulte, Jul 08 2015
G.f.: 2 / (1 - x + sqrt(1 - 2*x - 3*x^2) - 2*x*y) = Sum_{n >= k >= 0} T(n, k) * x^n * y^k. - Michael Somos, Jun 06 2016
T(n,k) = binomial(n, k)*hypergeom([(k-n)/2, (k-n+1)/2], [k+2], 4). - Peter Luschny, May 19 2021
The coefficients of the n-th degree Taylor polynomial of the function (1 - x^2)*(1 + x + x^2)^n expanded about the point x = 0 give the entries in row n in reverse order. - Peter Bala, Sep 06 2022

Extensions

More terms from Vladeta Jovovic, Sep 23 2001

A026300 Motzkin triangle, T, read by rows; T(0,0) = T(1,0) = T(1,1) = 1; for n >= 2, T(n,0) = 1, T(n,k) = T(n-1,k-2) + T(n-1,k-1) + T(n-1,k) for k = 1,2,...,n-1 and T(n,n) = T(n-1,n-2) + T(n-1,n-1).

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 3, 5, 4, 1, 4, 9, 12, 9, 1, 5, 14, 25, 30, 21, 1, 6, 20, 44, 69, 76, 51, 1, 7, 27, 70, 133, 189, 196, 127, 1, 8, 35, 104, 230, 392, 518, 512, 323, 1, 9, 44, 147, 369, 726, 1140, 1422, 1353, 835, 1, 10, 54, 200, 560, 1242, 2235, 3288, 3915, 3610, 2188
Offset: 0

Views

Author

Keywords

Comments

Right-hand columns have g.f. M^k, where M is g.f. of Motzkin numbers.
Consider a semi-infinite chessboard with squares labeled (n,k), ranks or rows n >= 0, files or columns k >= 0; number of king-paths of length n from (0,0) to (n,k), 0 <= k <= n, is T(n,n-k). - Harrie Grondijs, May 27 2005. Cf. A114929, A111808, A114972.

Examples

			Triangle starts:
  [0] 1;
  [1] 1, 1;
  [2] 1, 2,  2;
  [3] 1, 3,  5,   4;
  [4] 1, 4,  9,  12,   9;
  [5] 1, 5, 14,  25,  30,  21;
  [6] 1, 6, 20,  44,  69,  76,   51;
  [7] 1, 7, 27,  70, 133, 189,  196,  127;
  [8] 1, 8, 35, 104, 230, 392,  518,  512,  323;
  [9] 1, 9, 44, 147, 369, 726, 1140, 1422, 1353, 835.
		

References

  • Harrie Grondijs, Neverending Quest of Type C, Volume B - the endgame study-as-struggle.
  • A. Nkwanta, Lattice paths and RNA secondary structures, in African Americans in Mathematics, ed. N. Dean, Amer. Math. Soc., 1997, pp. 137-147.

Crossrefs

Reflected version is in A064189.
Row sums are in A005773.
T(n,n) are Motzkin numbers A001006.
Other columns of T include A002026, A005322, A005323.

Programs

  • Haskell
    a026300 n k = a026300_tabl !! n !! k
    a026300_row n = a026300_tabl !! n
    a026300_tabl = iterate (\row -> zipWith (+) ([0,0] ++ row) $
                                    zipWith (+) ([0] ++ row) (row ++ [0])) [1]
    -- Reinhard Zumkeller, Oct 09 2013
    
  • Maple
    A026300 := proc(n,k)
       add(binomial(n,2*i+n-k)*(binomial(2*i+n-k,i) -binomial(2*i+n-k,i-1)), i=0..floor(k/2));
    end proc: # R. J. Mathar, Jun 30 2013
  • Mathematica
    t[n_, k_] := Sum[ Binomial[n, 2i + n - k] (Binomial[2i + n - k, i] - Binomial[2i + n - k, i - 1]), {i, 0, Floor[k/2]}]; Table[ t[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Robert G. Wilson v, Jan 03 2011 *)
    t[, 0] = 1; t[n, 1] := n; t[n_, k_] /; k>n || k<0 = 0; t[n_, n_] := t[n, n] = t[n-1, n-2]+t[n-1, n-1]; t[n_, k_] := t[n, k] = t[n-1, k-2]+t[n-1, k-1]+t[n-1, k]; Table[t[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Apr 18 2014 *)
    T[n_, k_] := Binomial[n, k] Hypergeometric2F1[1/2 - k/2, -k/2, n - k + 2, 4];
    Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Peter Luschny, Mar 21 2018 *)
  • PARI
    tabl(nn) = {for (n=0, nn, for (k=0, n, print1(sum(i=0, k\2, binomial(n, 2*i+n-k)*(binomial(2*i+n-k, i)-binomial(2*i+n-k, i-1))), ", ");); print(););} \\ Michel Marcus, Jul 25 2015

Formula

T(n,k) = Sum_{i=0..floor(k/2)} binomial(n, 2i+n-k)*(binomial(2i+n-k, i) - binomial(2i+n-k, i-1)). - Herbert Kociemba, May 27 2004
T(n,k) = A027907(n,k) - A027907(n,k-2), k<=n.
Sum_{k=0..n} (-1)^k*T(n,k) = A099323(n+1). - Philippe Deléham, Mar 19 2007
Sum_{k=0..n} (T(n,k) mod 2) = A097357(n+1). - Philippe Deléham, Apr 28 2007
Sum_{k=0..n} T(n,k)*x^(n-k) = A005043(n), A001006(n), A005773(n+1), A059738(n) for x = -1, 0, 1, 2 respectively. - Philippe Deléham, Nov 28 2009
T(n,k) = binomial(n, k)*hypergeom([1/2 - k/2, -k/2], [n - k + 2], 4). - Peter Luschny, Mar 21 2018
T(n,k) = [t^(n-k)] [x^n] 2/(1 - (2*t + 1)*x + sqrt((1 + x)*(1 - 3*x))). - Peter Luschny, Oct 24 2018
The n-th row polynomial R(n,x) equals the n-th degree Taylor polynomial of the function (1 - x^2)*(1 + x + x^2)^n expanded about the point x = 0. - Peter Bala, Feb 26 2023

Extensions

Corrected and edited by Johannes W. Meijer, Oct 05 2010

A020474 A Motzkin triangle: a(n,k), n >= 2, 2 <= k <= n, = number of complete, strictly subdiagonal staircase functions.

Original entry on oeis.org

1, 0, 1, 0, 1, 2, 0, 0, 2, 4, 0, 0, 1, 5, 9, 0, 0, 0, 3, 12, 21, 0, 0, 0, 1, 9, 30, 51, 0, 0, 0, 0, 4, 25, 76, 127, 0, 0, 0, 0, 1, 14, 69, 196, 323, 0, 0, 0, 0, 0, 5, 44, 189, 512, 835, 0, 0, 0, 0, 0, 1, 20, 133, 518, 1353, 2188, 0, 0, 0, 0, 0, 0, 6, 70, 392, 1422, 3610, 5798, 0, 0, 0, 0
Offset: 2

Views

Author

Keywords

Comments

T(n,k) = number of Dyck n-paths that start UU, contain no DUDU and no subpath of the form UUPDD with P a nonempty Dyck path and whose terminal descent has length n-k+2. For example, T(5,4)=2 counts UUDUUDUDDD, UUUDDUUDDD (each ending with exactly n-k+2=3 Ds). - David Callan, Sep 25 2006

Examples

			Triangle begins:
  1
  0, 1
  0, 1, 2
  0, 0, 2, 4
  0, 0, 1, 5,  9
  0, 0, 0, 3, 12, 21
  0, 0, 0, 1,  9, 30, 51
  0, 0, 0, 0,  4, 25, 76, 127
  0, 0, 0, 0,  1, 14, 69, 196, 323
		

Crossrefs

Main diagonal is A001006.
Other diagonals include A002026, A005322, A005323, A005324, A005325. Row sums are (essentially) A005043.
The triangle version of A062105 has the same recurrence with different initial conditions. - N. J. A. Sloane, Apr 11 2020

Programs

  • Haskell
    a020474 n k = a020474_tabl !! (n-2) !! (k-2)
    a020474_row n = a020474_tabl !! (n-2)
    a020474_tabl = map fst $ iterate f ([1], [0,1]) where
       f (us,vs) = (vs, scanl (+) 0 ws) where
         ws = zipWith (+) (us ++ [0]) vs
    -- Reinhard Zumkeller, Jan 03 2013
    
  • Maple
    M:=16; T:=Array(0..M,0..M,0);
    T[0,0]:=1; T[1,1]:=1;
    for i from 1 to M do T[i,0]:=0; od:
    for n from 2 to M do for k from 1 to n do
    T[n,k]:= T[n,k-1]+T[n-1,k-1]+T[n-2,k-1];
    od: od;
    rho:=n->[seq(T[n,k],k=0..n)];
    for n from 0 to M do lprint(rho(n)); od: # N. J. A. Sloane, Apr 11 2020
  • Mathematica
    a[2,2]=1; a[n_,k_]/;Not[n>2 && 2<=k<=n] := 0; a[n_,k_]/;(n>2 && 2<=k<=n) := a[n,k] = a[n,k-1] + a[n-1,k-1] + a[n-2,k-1]; Table[a[n,k],{n,2,10},{k,2,n}] (* David Callan, Sep 25 2006 *)
  • PARI
    T(n,k)=if(n==0&&k==0,1,if(n<=0||k<=0||nRalf Stephan
    
  • Sage
    @cached_function
    def T(n, k):
        if k<0 or nPeter Luschny, Jun 23 2015

Formula

a(n,k) = a(n,k-1) + a(n-1,k-1) + a(n-2,k-1), n > k >= 2.

Extensions

More terms from James Sellers, Feb 04 2000

A348840 Triangle T(n,h) read by rows: The number of Motzkin Paths of n>=2 steps that start with an Up step and touch the horizontal axis h>=1 times afterwards.

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 4, 4, 3, 1, 9, 9, 7, 4, 1, 21, 21, 17, 11, 5, 1, 51, 51, 42, 29, 16, 6, 1, 127, 127, 106, 76, 46, 22, 7, 1, 323, 323, 272, 200, 128, 69, 29, 8, 1, 835, 835, 708, 530, 352, 204, 99, 37, 9, 1, 2188, 2188, 1865, 1415, 965, 587, 311, 137, 46, 10, 1, 5798, 5798, 4963
Offset: 2

Views

Author

R. J. Mathar, Nov 01 2021

Keywords

Comments

To touch means: the path reaches the horizontal line with a down-step, or it is at the horizontal level and takes another horizontal step.

Examples

			The triangle starts:
     1
     1    1
     2    2    1
     4    4    3    1
     9    9    7    4    1
    21   21   17   11    5    1
    51   51   42   29   16    6   1
   127  127  106   76   46   22   7   1
   323  323  272  200  128   69  29   8   1
   835  835  708  530  352  204  99  37   9  1
  2188 2188 1865 1415  965  587 311 137  46 10  1
  5798 5798 4963 3805 2647 1667 937 457 184 56 11  1
  ...
T(n,n-1)=1 counts udhhhhh... staying on the horizontal line.
T(4,1)=2 counts uudd, uhhd.
T(4,2)=2 counts udud, uhdh.
T(4,3)=1 counts udhh.
T(5,1)=4 counts uudhd uuhdd uhudd uhhhd.
T(5,2)=4 counts uuddh uduhd uhdud uhhdh.
T(5,3)=3 counts ududh udhud uhdhh.
T(5,4)=1 counts udhhh.
		

Crossrefs

Cf. A002026 (row sums), A001006 (columns h=1,2), A102071 (column h=3).

Programs

  • Maple
    b:= proc(x, y) option remember; expand(`if`(y>x or y<0, 0,
         `if`(x=0, 1, add(b(x-1, y-j), j=-1..1))*`if`(y=0, z, 1)))
        end:
    T:= n-> (p-> seq(coeff(p, z, i), i=1..n-1))(b(n-1, 1)):
    seq(T(n), n=2..14);  # Alois P. Heinz, Nov 01 2021
  • Mathematica
    b[x_, y_] := b[x, y] = Expand[If[y > x || y < 0, 0,
         If[x == 0, 1, Sum[b[x - 1, y - j], {j, -1, 1}]]*If[y == 0, z, 1]]];
    T[n_] := Function[p, Table[Coefficient[p, z, i], {i, 1, n-1}]][b[n-1, 1]];
    Table[T[n], {n, 2, 14}] // Flatten (* Jean-François Alcover, Mar 17 2022, after Alois P. Heinz *)

Formula

Conjecture: T(n,n-2) = n-2.
Conjecture: T(n,n-3) = A000124(n-3).
Conjecture: T(n,n-4) = -11 + 19*n/3 - 3*n^2/2 + n^3/6.
From Alois P. Heinz, Nov 01 2021: (Start)
Sum_{k=1..n-1} k * T(n,k) = A005322(n).
T(2n,n) = A344502(n-1) for n >= 1. (End)
Conjecture: Riordan array (g(x)^2, x*g(x)), where g(x) = 1/(1 + x)*c(x/(1 + x)) and c(x) = (1 - sqrt(1 - 4*x))/(2*x) is the g.f. of the Catalan numbers A000108. - Peter Bala, Feb 04 2024

A026134 a(n) = Sum_{k=1..n} T(k, k-1), where T is the array in A026120.

Original entry on oeis.org

1, 2, 6, 16, 44, 120, 329, 904, 2493, 6898, 19151, 53340, 149019, 417522, 1172979, 3303696, 9326931, 26390070, 74824584, 212565864, 604972998, 1724739940, 4925066567, 14085122376, 40339596755, 115688495806, 332203673142, 955090832416, 2749055259956, 7921280088744
Offset: 1

Views

Author

Keywords

Crossrefs

T(n, n+2), where T is given by A026148, T(n, n-2), where T is the array defined in A026105 and T(n, n+1), where T is given by A026323.
First differences of A005322.
Cf. A026123.

Formula

G.f.: z(1-z)M^3, with M the g.f. of the Motzkin numbers (A001006).

Extensions

a(25) corrected and more terms from Sean A. Irvine, Sep 17 2019

A106489 Triangle read by rows: T(n,k) is the number of short bushes with n edges and having the leftmost leaf at height k (a short bush is an ordered tree with no nodes of outdegree 1).

Original entry on oeis.org

1, 1, 2, 1, 4, 2, 9, 5, 1, 21, 12, 3, 51, 30, 9, 1, 127, 76, 25, 4, 323, 196, 69, 14, 1, 835, 512, 189, 44, 5, 2188, 1353, 518, 133, 20, 1, 5798, 3610, 1422, 392, 70, 6, 15511, 9713, 3915, 1140, 230, 27, 1, 41835, 26324, 10813, 3288, 726, 104, 7, 113634, 71799, 29964
Offset: 2

Views

Author

Emeric Deutsch, May 29 2005

Keywords

Comments

Basically, the mirror image of A020474. Row n has floor(n/2) terms (first row is row 2). Row sums yield the Riordan numbers (A005043). Column 1 yields the Motzkin numbers (A001006); column 2 yields A002026; column 3 yields A005322; column 4 yields A005323; column 4 yields A005324; column 5 yields A005325; column 6 yields A005326.
T(n,k) is the number of Riordan paths (Motzkin paths with no flatsteps on the x-axis) with k returns to the x-axis. For example, T(6,2) = 5 counts UDUFFD, UDUUDD, UFDUFD, UFFDUD, UUDDUD where U = (1,1) is an upstep, F = (1,0) is a flatstep, and D = (1,-1) is a downstep. - David Callan, Dec 12 2021

Examples

			Column 1 yields the Motzkin numbers: indeed, if from each short bush, having leftmost leaf at height 1, we drop the leftmost edge, then we obtain the so-called bushes, known to be counted by the Motzkin numbers.
Triangle begins:
   1;
   1;
   2,  1;
   4,  2;
   9,  5,  1;
  21, 12,  3;
  51, 30,  9,  1.
		

Crossrefs

Programs

  • Maple
    S:=1/2/(z+z^2)*(1+z-sqrt(1-2*z-3*z^2)): G:=simplify(t*z^2*S/(1-z*S-t*z^2*S)): Gserz:=simplify(series(G,z=0,19)): for n from 2 to 17 do P[n]:=sort(coeff(Gserz,z^n)) od: for n from 2 to 17 do seq(coeff(P[n],t^k),k=1..floor(n/2)) od; # yields sequence in triangular form
  • Mathematica
    (* To generate the sequence *)
    CoefficientList[CoefficientList[Series[(1-t-2xt^2-Sqrt[1-2t-3t^2])/(2t^2(1-x+xt+x^2t^2)), {t,0,10}], t], x] // Flatten
    (* To generate the triangle *)
    CoefficientList[Series[(1-t-2xt^2-Sqrt[1-2t-3t^2])/(2t^2(1-x+xt+x^2t^2)), {t, 0, 10}], {t, x}] // MatrixForm
    Table[If[n < 2 k, 0, GegenbauerC[n-2k,-n+k-1,-1/2](k+1)/(n-k+1)], {n,0,10}, {k,0,5}] // MatrixForm
    (* Emanuele Munarini, Feb 10 2018 *)

Formula

G.f.: tz^2*S/(1 - zS - tz^2*S), where S = S(z) = (1 + z - sqrt(1 - 2z - 3z^2))/(2z(1+z)) is the g.f. of the short bushes (the Riordan numbers; A005043).
a(n,k) = T(n-k+1, n-2*k)*(k+1)/(n-k+1), for n >= 2k, where T(n,k) = A027907(n,k) are the trinomial coefficients. - Emanuele Munarini, Feb 10 2018
The rows are the antidiagonals of the Motzkin triangle A064189. - Peter Luschny, Feb 01 2025

A123261 Multiplicative encoding of Motzkin triangle (A026300).

Original entry on oeis.org

2, 6, 450, 405168750, 10326560651880195445980468750, 17149769349660883198128523550890723880659651223306378240865271303752564539222570800781250
Offset: 1

Views

Author

Jonathan Vos Post, Nov 06 2006

Keywords

Comments

This is to A026300 "Motzkin triangle, T, read by rows; T(0,0) = T(1,0) = T(1,1) = 1; for n >= 2, T(n,0) = 1, T(n,k) = T(n-1,k-2) + T(n-1,k-1) + T(n-1,k) for k = 1,2,...,n-1 and T(n,n) = T(n-1,n-2) + T(n-1,n-1)" as A007188 "Multiplicative encoding of Pascal triangle: Product p(i+1)^C(n,i)" is to A007318 "Pascal's triangle read by rows."

Examples

			a(1) = p(1)^T(1,1) = 2^1 = 2.
a(2) = p(1)^T(2,1) * p(2)^T(2,2) = 2^1 * 3^1 = 6.
a(3) = p(1)^T(3,1) * p(2)^T(3,2) * p(3)^T(3,3) = 2^1 * 3^2 * 5^2 = 450.
a(4) = 2^1 * 3^3 * 5^5 * 7^4 = 405168750.
a(5) = 2^1 * 3^4 * 5^9 * 7^12 * 11^9 = 10326560651880195445980468750.
a(6) = 2^1 * 3^5 * 5^14 * 7^25 * 11^30 * 13^21.
a(7) = 2^1 * 3^6 * 5^20 * 7^44 * 11^69 * 13^76 * 17^51.
		

Crossrefs

Cf. A000040, A007188, A007318, A009766, A124061, Motzkin numbers (A001006) are T(n, n), other columns of T include A002026, A005322, A005323.

Formula

a(n) = Product_{i=1..n} p(i+1)^T(n,i), where T(n,i), are as in Motzkin triangle (A026300), T(0,0) = T(1,0) = T(1,1) = 1; for n >= 2, T(n,0) = 1, T(n,k) = T(n-1,k-2) + T(n-1,k-1) + T(n-1,k) for k = 1,2,...,n-1 and T(n,n) = T(n-1,n-2) + T(n-1,n-1).
Showing 1-8 of 8 results.