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.

A029618 Numbers in (3,2)-Pascal triangle (by row).

Original entry on oeis.org

1, 3, 2, 3, 5, 2, 3, 8, 7, 2, 3, 11, 15, 9, 2, 3, 14, 26, 24, 11, 2, 3, 17, 40, 50, 35, 13, 2, 3, 20, 57, 90, 85, 48, 15, 2, 3, 23, 77, 147, 175, 133, 63, 17, 2, 3, 26, 100, 224, 322, 308, 196, 80, 19, 2, 3, 29, 126, 324, 546, 630, 504, 276, 99, 21, 2, 3, 32, 155, 450, 870
Offset: 0

Views

Author

Keywords

Comments

Reverse of A029600. - Philippe Deléham, Nov 21 2006
Triangle T(n,k), read by rows, given by (3,-2,0,0,0,0,0,0,0,...) DELTA (2,-1,0,0,0,0,0,0,0,...) where DELTA is the operator defined in A084938. - Philippe Deléham, Oct 10 2011
Row n: expansion of (3+2x)*(1+x)^(n-1), n>0. - Philippe Deléham, Oct 10 2011
For a closed-form formula for generalized Pascal's triangle see A228576. - Boris Putievskiy, Sep 04 2013

Examples

			Triangle begins as:
  1;
  3,  2;
  3,  5,  2;
  3,  8,  7,  2;
  3, 11, 15,  9,  2;
  ...
		

Crossrefs

Cf. A007318, A029600, A084938, A228196, A228576, A016789 (2nd column), A005449 (3rd column), A006002 (4th column).

Programs

  • GAP
    T:= function(n,k)
        if n=0 and k=0 then return 1;
        elif k=0 then return 3;
        elif k=n then return 2;
        else return T(n-1,k-1) + T(n-1,k);
        fi;
      end;
    Flat(List([0..12], n-> List([0..n], k-> T(n,k) ))); # G. C. Greubel, Nov 12 2019
  • Maple
    A029618 := proc(n,k)
        if k < 0 or k > n then
            0;
        elif  n = 0 then
            1;
        elif k=0 then
            3;
        elif k = n then
            2;
        else
            procname(n-1,k-1)+procname(n-1,k) ;
        end if;
    end proc: # R. J. Mathar, Jul 08 2015
  • Mathematica
    T[n_, k_]:= T[n, k]= If[n==0 && k==0, 1, If[k==0, 3, If[k==n, 2, T[n-1, k-1] + T[n-1, k] ]]]; Table[T[n, k], {n, 0, 12}, {k, 0, n}]//Flatten (* G. C. Greubel, Nov 13 2019 *)
  • PARI
    T(n,k) = if(n==0 && k==0, 1, if(k==0, 3, if(k==n, 2, T(n-1, k-1) + T(n-1, k) ))); \\ G. C. Greubel, Nov 12 2019
    
  • Sage
    @CachedFunction
    def T(n, k):
        if (n==0 and k==0): return 1
        elif (k==0): return 3
        elif (k==n): return 2
        else: return T(n-1,k-1) + T(n-1, k)
    [[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Nov 12 2019
    

Formula

T(n,k) = T(n-1,k-1) + T(n-1,k) with T(0,0)=1, T(n,0)=3, T(n,n)=2; n, k > 0. - Boris Putievskiy, Sep 04 2013
G.f.: (-1-x*y-2*x)/(-1+x*y+x). - R. J. Mathar, Aug 11 2015