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.

A293172 Triangle read by rows: T(n,k) = number of colored weighted Motzkin paths ending at (n,k).

Original entry on oeis.org

1, 6, 1, 40, 10, 1, 280, 84, 14, 1, 2016, 672, 144, 18, 1, 14784, 5280, 1320, 220, 22, 1, 109824, 41184, 11440, 2288, 312, 26, 1, 823680, 320320, 96096, 21840, 3640, 420, 30, 1, 6223360, 2489344, 792064, 198016, 38080, 5440, 544, 34, 1, 47297536, 19348992, 6449664, 1736448, 372096, 62016, 7752
Offset: 0

Views

Author

N. J. A. Sloane, Oct 19 2017

Keywords

Examples

			Triangle begins:
1,
6,1,
40,10,1,
280,84,14,1,
2016,672,144,18,1,
14784,5280,1320,220,22,1,
...
		

Crossrefs

First column is A069720.

Programs

  • Maple
    A293172 := proc(n,k)
        option remember;
        local b,d,r,c,e;
        b := 4; d:= 2; r := 2 ; c := r^2 ; e := d ;
        if k < 0 or k > n then
            0;
        elif k = n then
            1;
        elif k = 0 then
            (b+e)*procname(n-1,0)+c*procname(n-1,1) ;
        else
            procname(n-1,k-1)+b*procname(n-1,k)+c*procname(n-1,k+1) ;
        end if;
    end proc:
    seq(seq( A293172(n,k),k=0..n),n=0..15) ; # R. J. Mathar, Oct 27 2017
  • Mathematica
    T[n_, k_] := T[n, k] = Module[{b = 4, d = 2, r = 2, c, e}, c = r^2; e = d; If[k < 0 || k > n, 0, If[k == n, 1, If[k == 0, (b + e) T[n - 1, 0] + c T[n - 1, 1], T[n - 1, k - 1] + b T[n - 1, k] + c T[n - 1, k + 1]]]]];
    Table[T[n, k], {n, 0, 15}, {k, 0, n}] // Flatten (* Jean-François Alcover, Apr 07 2020, from Maple *)