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.

A072405 Triangle T(n, k) = C(n,k) - C(n-2,k-1) for n >= 3 and T(n, k) = 1 otherwise, read by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 3, 4, 3, 1, 1, 4, 7, 7, 4, 1, 1, 5, 11, 14, 11, 5, 1, 1, 6, 16, 25, 25, 16, 6, 1, 1, 7, 22, 41, 50, 41, 22, 7, 1, 1, 8, 29, 63, 91, 91, 63, 29, 8, 1, 1, 9, 37, 92, 154, 182, 154, 92, 37, 9, 1, 1, 10, 46, 129, 246, 336, 336, 246, 129, 46, 10, 1, 1, 11, 56, 175, 375, 582, 672, 582, 375, 175, 56, 11, 1
Offset: 0

Views

Author

Henry Bottomley, Jun 16 2002

Keywords

Comments

Starting 1,0,1,1,1,... this is the Riordan array ((1-x+x^2)/(1-x), x/(1-x)). Its diagonal sums are A006355. Its inverse is A106509. - Paul Barry, May 04 2005

Examples

			Rows start as:
  1;
  1, 1;
  1, 1,  1; (key row for starting the recurrence)
  1, 2,  2,  1;
  1, 3,  4,  3,  1;
  1, 4,  7,  7,  4, 1;
  1, 5, 11, 14, 11, 5, 1;
		

Crossrefs

Row sums give essentially A003945, A007283, or A042950.
Cf. A072406 for number of odd terms in each row.
Cf. A051597, A096646, A122218 (identical for n > 1).
Cf. A007318 (q=0), A072405 (q= -1), A173117 (q=1), A173118 (q=2), A173119 (q=3), A173120 (q=-4).

Programs

  • Magma
    T:= func< n,k | n lt 3 select 1 else Binomial(n,k) - Binomial(n-2,k-1) >;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Apr 28 2021
    
  • Mathematica
    t[2, 1] = 1; t[n_, n_] = t[, 0] = 1; t[n, k_] := t[n, k] = t[n-1, k-1] + t[n-1, k]; Table[t[n, k], {n, 0, 12}, {k, 0, n}] // Flatten (* Jean-François Alcover, Nov 28 2013, after Ralf Stephan *)
  • PARI
    A072405(n, k) = if(n>2, binomial(n, k)-binomial(n-2, k-1), 1) \\ M. F. Hasler, Jan 06 2024
  • Sage
    def T(n,k): return 1 if n<3 else binomial(n,k) - binomial(n-2,k-1)
    flatten([[T(n,k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Apr 28 2021
    

Formula

T(n, k) = C(n,k) - C(n-2,k-1) for n >= 3 and T(n, k) = 1 otherwise.
T(n, k) = T(n-1, k-1) + T(n-1, k) starting with T(2, 0) = T(2, 1) = T(2, 2) = 1 and T(n, 0) = T(n, n) = 1.
G.f.: (1-x^2*y) / (1 - x*(1+y)). - Ralf Stephan, Jan 31 2005
From G. C. Greubel, Apr 28 2021: (Start)
Sum_{k=0..n} T(n, k) = (n+1)*[n<3] + 3*2^(n-2)*[n>=3].
T(n, k, q) = q*[n=2] + Sum_{j=0..5} q^j*binomial(n-2*j, k-j)*[n>2*j] with T(n,0) = T(n,n) = 1 for q = -1. (End)