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.

A131108 T(n,k) = 2*A007318(n,k) - A097806(n,k).

Original entry on oeis.org

1, 1, 1, 2, 3, 1, 2, 6, 5, 1, 2, 8, 12, 7, 1, 2, 10, 20, 20, 9, 1, 2, 12, 30, 40, 30, 11, 1, 2, 14, 42, 70, 70, 42, 13, 1, 2, 16, 56, 112, 140, 112, 56, 15, 1, 2, 18, 72, 168, 252, 252, 168, 72, 17, 1, 2, 20, 90, 240, 420, 504, 420, 240, 90, 19, 1
Offset: 0

Views

Author

Gary W. Adamson, Jun 15 2007

Keywords

Comments

Row sums give A095121.
Triangle T(n,k), 0 <= k <= n, read by rows given by [1, 1, -2, 1, 0, 0, 0, 0, 0, 0, 0, ...] DELTA [1,0,0,1,0,0,0,0,0,0,0,...] where DELTA is the operator defined in A084938. - Philippe Deléham, Dec 18 2007

Examples

			First few rows of the triangle are:
  1;
  1,  1;
  2,  3,  1;
  2,  6,  5,  1;
  2,  8, 12,  7, 1;
  2, 10, 20, 20, 9, 1;
...
		

Crossrefs

Programs

  • Magma
    function T(n,k)
      if k eq n-1 then return 2*n-1;
      elif k eq n then return 1;
      else return 2*Binomial(n,k);
      end if;
      return T;
    end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Nov 18 2019
    
  • Maple
    seq(seq( `if`(k=n-1, 2*n-1, `if`(k=n, 1, 2*binomial(n,k))), k=0..n), n=0..12); # G. C. Greubel, Nov 18 2019
  • Mathematica
    Table[If[k==n-1, 2*n-1, If[k==n, 1, 2*Binomial[n, k]]], {n,0,12}, {k,0, n}]//Flatten (* G. C. Greubel, Nov 18 2019 *)
  • PARI
    T(n,k) = if(k==n-1, 2*n-1, if(k==n, 1, 2*binomial(n,k))); \\ G. C. Greubel, Nov 18 2019
    
  • Sage
    @CachedFunction
    def T(n, k):
        if (k==n-1): return 2*n-1
        elif (k==n): return 1
        else: return 2*binomial(n,k)
    [[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Nov 18 2019

Formula

Twice Pascal's triangle minus A097806, the pairwise operator.
G.f.: (1-x*y+x^2+x^2*y)/((-1+x+x*y)*(x*y-1)). - R. J. Mathar, Aug 11 2015

Extensions

Corrected by Philippe Deléham, Dec 17 2007
More terms added and data corrected by G. C. Greubel, Nov 18 2019