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.

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

Original entry on oeis.org

1, 1, 1, 9, 2, 1, 25, 15, 3, 1, 145, 52, 22, 4, 1, 561, 285, 90, 30, 5, 1, 2841, 1206, 495, 140, 39, 6, 1, 12489, 6027, 2261, 791, 203, 49, 7, 1, 60705, 27560, 11452, 3864, 1190, 280, 60, 8, 1, 281185, 134073, 54468, 20076, 6174, 1710, 372, 72, 9, 1, 1353769, 633130, 268845, 99240, 33090, 9372, 2370, 480, 85, 10, 1
Offset: 0

Views

Author

N. J. A. Sloane, Oct 19 2017

Keywords

Examples

			Triangle begins:
1,
1,1,
9,2,1,
25,15,3,1,
145,52,22,4,1,
561,285,90,30,5,1,
...
		

Crossrefs

First column is A084605, 2nd A098520.

Programs

  • Maple
    A293171 := proc(n,k)
        option remember;
        local b,e,c;
        b := 1; e:= 2; c := e^2 ;
        if k < 0 or k > n then
            0;
        elif k = n then
            1;
        elif k = 0 then
            b*procname(n-1,0)+2*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( A293171(n,k),k=0..n),n=0..15) ; # R. J. Mathar, Oct 27 2017
  • Mathematica
    T[n_, k_] := T[n, k] = Module[{b=1, e=2, c=4}, Which[k<0 || k>n, 0, k==n, 1, k == 0, b*T[n-1, 0] + 2*c*T[n-1, 1], True, T[n-1, k-1] + b*T[n-1, k] + c*T[n-1, k+1]]];
    Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Dec 19 2019, after R. J. Mathar *)