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.

A156319 Triangle by columns: (1, 2, 0, 0, 0, ...) in every column.

Original entry on oeis.org

1, 2, 1, 0, 2, 1, 0, 0, 2, 1, 0, 0, 0, 2, 1, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1
Offset: 1

Views

Author

Gary W. Adamson, Feb 07 2009

Keywords

Comments

Binomial transform of the triangle = A110813.
Eigensequence of the triangle = A001045
Inverse = a triangle with (1, -2, 4, -8, 16, ...) in every column.
Triangle T(n,k), 0 <= k <= n, given by [2,-2,0,0,0,0,0,0,...] DELTA [1,0,0,0,0,0,0,0,...] where DELTA is the operator defined in A084938. - Philippe Deléham, Feb 08 2009

Examples

			First few rows of the triangle:
  1;
  2, 1;
  0, 2, 1;
  0, 0, 2, 1;
  0, 0, 0, 2, 1;
  0, 0, 0, 0, 2, 1;
  0, 0, 0, 0, 0, 2, 1;
  0, 0, 0, 0, 0, 0, 2, 1;
  0, 0, 0, 0, 0, 0, 0, 2, 1;
...
		

Crossrefs

Programs

  • GAP
    T:= function(n,k)
        if k=n then return 1;
        elif k=n-1 then return 2;
        else return 0;
        fi;
      end;
    Flat(List([1..15], n-> List([1..n], k-> T(n,k) ))); # G. C. Greubel, Sep 20 2019
  • Magma
    T:= func< n,k | k eq n select 1 else k eq n-1 select 2 else 0 >;
    [T(n,k): k in [1..n], n in [1..15]]; // G. C. Greubel, Sep 20 2019
    
  • Maple
    T:= proc (n) option remember;
    if k=n then 1
    elif k=n-1 then 2
    else 0 fi;
    end proc;
    seq(seq(T(n,k), k=1..n), n = 1..15); # G. C. Greubel, Sep 20 2019
  • Mathematica
    Table[If[k==n,1, If[k==n-1, 2, 0]], {n,15}, {k,n}]//Flatten (* G. C. Greubel, Sep 20 2019 *)
    Join[{1},Flatten[Table[PadRight[{2,1},n,0],{n,3,20}]]] (* Harvey P. Dale, Feb 28 2022 *)
  • PARI
    T(n,k) = if(k==n, 1, if(k==n-1, 2, 0)); \\ G. C. Greubel, Sep 20 2019
    
  • Sage
    def T(n,k):
        if (k==n): return 1
        elif (k==n-1): return 2
        else: return 0
    [[T(n,k) for k in (1..n)] for n in (1..15)] # G. C. Greubel, Sep 20 2019
    

Formula

Triangle read by rows, T(n,k) = 1 if n=k, 2 if k = n-1, 0 otherwise.
By columns, (1, 2, 0, 0, 0, ...) in every column.
T(n,k) = A097806(n,k)*2^(n-k). - Philippe Deléham, Feb 08 2009
G.f.: (1+2*x)*x*y/(1-x*y). - R. J. Mathar, Aug 12 2015

Extensions

More terms added by G. C. Greubel, Sep 20 2019