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.

A052174 Triangle of numbers arising in enumeration of walks on square lattice.

Original entry on oeis.org

1, 1, 1, 3, 2, 1, 6, 8, 3, 1, 20, 20, 15, 4, 1, 50, 75, 45, 24, 5, 1, 175, 210, 189, 84, 35, 6, 1, 490, 784, 588, 392, 140, 48, 7, 1, 1764, 2352, 2352, 1344, 720, 216, 63, 8, 1, 5292, 8820, 7560, 5760, 2700, 1215, 315, 80, 9, 1
Offset: 0

Views

Author

N. J. A. Sloane, Jan 26 2000

Keywords

Examples

			First few rows:
    1;
    1   1;
    3   2   1;
    6   8   3  1;
   20  20  15  4  1;
   50  75  45 24  5 1;
  175 210 189 84 35 6 1;
  ...
		

Crossrefs

Cf. A005558 (first column), A005559, A005560, A005561, A005562.

Programs

  • Mathematica
    c = Binomial; T[n_, m_] /; EvenQ[n-m] := (k = (n-m)/2; c[n+1, k]*c[n, k] - c[n+1, k]*c[n, k-1]); T[n_, m_] /; OddQ[n-m] := (k = (n-m-1)/2; c[n+1, k]*c[n, k+1] - c[n+1, k+1]*c[n, k-1]); Table[T[n, m], {n, 0, 9}, {m, 0, n}] // Flatten (* Jean-François Alcover, Jan 13 2015, after Michel Marcus *)
  • PARI
    tabl(nn) = {alias(C, binomial); for (n=0, nn, for (k=0, n, if (!((n-k) % 2), kk = (n-k)/2; tnk = C(n+1,kk)*C(n,kk) - C(n+1,kk)*C(n,kk-1), kk = (n-k-1)/2; tnk = C(n+1,kk)*C(n,kk+1) - C(n+1,kk+1)*C(n,kk-1)); print1(tnk, ", ");); print(););} \\ Michel Marcus, Oct 12 2014

Formula

T(n, y) equals C(n+1,k)*C(n,k) - C(n+1,k)*C(n,k-1) if n-y = 2k, else if n-y = 2k+1 equals C(n+1,k)*C(n,k+1) - C(n+1,k+1)*C(n,k-1) (using article notation). - Michel Marcus, Oct 12 2014