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.

A201639 Triangle read by rows, T(n,k) for 0<=k<=n, generalizes the Motzkin lattice paths with weights of A003645.

Original entry on oeis.org

1, 4, 1, 20, 8, 1, 112, 56, 12, 1, 672, 384, 108, 16, 1, 4224, 2640, 880, 176, 20, 1, 27456, 18304, 6864, 1664, 260, 24, 1, 183040, 128128, 52416, 14560, 2800, 360, 28, 1, 1244672, 905216, 396032, 121856, 27200, 4352, 476, 32, 1, 8599552, 6449664, 2976768
Offset: 0

Views

Author

Peter Luschny, Sep 20 2012

Keywords

Examples

			[0] [1]
[1] [4, 1]
[2] [20, 8, 1]
[3] [112, 56, 12, 1]
[4] [672, 384, 108, 16, 1]
[5] [4224, 2640, 880, 176, 20, 1]
[6] [27456, 18304, 6864, 1664, 260, 24, 1]
[7] [183040, 128128, 52416, 14560, 2800, 360, 28, 1]
		

Crossrefs

Sum of row n is A194723(n+1).
Cf. A003645.

Programs

  • GAP
    Flat(List([0..10], n->List([0..n],k->(k+1)*2^(n-k)*Binomial(2*(n+1),n-k)/(n+1)))); # Muniru A Asiru, Apr 07 2018
  • Magma
    /* As triangle */ [[(k+1)*2^(n-k)*Binomial(2*(n+1),n-k)/(n+1): k in [0..n]]: n in [0.. 15]]; // Vincenzo Librandi, Apr 07 2018
    
  • Mathematica
    Flatten[Table[(k + 1) 2^(n - k) Binomial[2 (n + 1), n - k] / (n + 1), {n, 0, 11}, {k, 0, n}]] (* Vincenzo Librandi, Apr 07 2018 *)
  • PARI
    T(n,k) = (k+1)*2^(n-k)*binomial(2*(n+1),n-k)/(n+1);
    tabl(nn) = for(n=0, nn, for (k=0, n, print1(T(n, k), ", ")); print); \\ Michel Marcus, Apr 07 2018
    
  • Sage
    def A201639_triangle(dim):
        T = matrix(ZZ,dim,dim)
        for n in range(dim): T[n,n] = 1
        for n in (1..dim-1):
            for k in (0..n-1):
                T[n,k] = T[n-1,k-1]+4*T[n-1,k]+4*T[n-1,k+1]
        return T
    A201639_triangle(9)
    

Formula

Recurrence: T(0,0)=1, T(0,k)=0 for k>0 and for n>=1 T(n,k) = T(n-1,k-1)+4*T(n-1,k)+4*T(n-1,k+1).
G.f.: -(4*x+sqrt(1-8*x)-1)/((4*x^2-x)*y+sqrt(1-8*x)*x*y+8*x^2). - Vladimir Kruchinin, Apr 06 2018
T(n,k) = (k+1)*2^(n-k)*C(2*(n+1),n-k)/(n+1). - Vladimir Kruchinin, Apr 06 2018