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.

A159855 Riordan array ((1-2*x-x^2)/(1-x), x/(1-x)).

Original entry on oeis.org

1, -1, 1, -2, 0, 1, -2, -2, 1, 1, -2, -4, -1, 2, 1, -2, -6, -5, 1, 3, 1, -2, -8, -11, -4, 4, 4, 1, -2, -10, -19, -15, 0, 8, 5, 1, -2, -12, -29, -34, -15, 8, 13, 6, 1, -2, -14, -41, -63, -49, -7, 21, 19, 7, 1, -2, -16, -55, -104, -112, -56, 14, 40, 26, 8, 1
Offset: 0

Views

Author

Philippe Deléham, Apr 24 2009

Keywords

Comments

The matrix inverse starts
1;
1, 1;
2, 0, 1;
2, 2, -1, 1;
4, 0, 3, -2, 1;
4, 4, -3, 5, -3, 1;
8, 0, 7, -8, 8, -4, 1;
8, 8, -7, 15, -16, 12, -5, 1;
16, 0, 15, -22, 31, -28, 17, -6, 1;
16, 16, -15, 37, -53, 59, -45, 23, -7, 1;
32, 0, 31, -52, 90, -112, 104, -68, 30, -8, 1;
- R. J. Mathar, Mar 29 2013

Examples

			Triangle begins:
   1;
  -1,  1;
  -2,  0,  1;
  -2, -2,  1,  1;
  -2, -4, -1,  2,  1;
  -2, -6, -5,  1,  3,  1;
		

Crossrefs

Cf. A159854.

Programs

  • GAP
    Flat(List([0..12],n->List([0..n],k->Binomial(n,n-k)-2*Binomial(n-1,n-k-1)-Binomial(n-2,n-k-2)))); # Muniru A Asiru, Mar 22 2018
    
  • Magma
    /* As triangle */ [[Binomial(n, n-k)-2*Binomial(n-1, n-k-1)-Binomial(n-2, n-k-2): k in [0..n]]: n in [0.. 15]]; // Vincenzo Librandi, Mar 22 2018
  • Maple
    C := proc (n, k) if 0 <= k and k <= n then factorial(n)/(factorial(k)*factorial(n-k)) else 0 end if end proc:
    for n from 0 to 10 do
      seq(C(n, n-k)-2*C(n-1, n-k-1)-C(n-2, n-k-2), k = 0..n)
    end do; # Peter Bala, Mar 20 2018
  • Mathematica
    (* The function RiordanArray is defined in A256893. *)
    RiordanArray[(1 - 2 # - #^2)/(1 - #)&, #/(1 - #)&, 11] // Flatten (* Jean-François Alcover, Jul 16 2019 *)
  • Sage
    # uses[riordan_array from A256893]
    riordan_array((1-2*x-x^2)/(1-x), x/(1-x), 8) # Peter Luschny, Mar 21 2018
    

Formula

T(n,k) = C(n,n-k) - 2*C(n-1,n-k-1) - C(n-2,n-k-2), where C(n,k) = n!/(k!*(n-k)!) for 0 <= k <= n, otherwise 0. - Peter Bala, Mar 20 2018

Extensions

Two data values in row 10 corrected by Peter Bala, Mar 20 2018