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.

A159623 Triangle read by rows: T(n, k) = n!*q^k/(n-k)! if floor(n/2) > k-1 otherwise n!*q^(n-k)/k!, with q = 1.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 12, 4, 1, 1, 5, 20, 20, 5, 1, 1, 6, 30, 120, 30, 6, 1, 1, 7, 42, 210, 210, 42, 7, 1, 1, 8, 56, 336, 1680, 336, 56, 8, 1, 1, 9, 72, 504, 3024, 3024, 504, 72, 9, 1, 1, 10, 90, 720, 5040, 30240, 5040, 720, 90, 10, 1
Offset: 0

Views

Author

Roger L. Bagula, Apr 17 2009

Keywords

Comments

The row sums are: {1, 2, 4, 8, 22, 52, 194, 520, 2482, 7220, 41962,...}.

Examples

			Triangle begins as:
  1;
  1,  1;
  1,  2,  1;
  1,  3,  3,   1;
  1,  4, 12,   4,    1;
  1,  5, 20,  20,    5,     1;
  1,  6, 30, 120,   30,     6,    1;
  1,  7, 42, 210,  210,    42,    7,   1;
  1,  8, 56, 336, 1680,   336,   56,   8,  1;
  1,  9, 72, 504, 3024,  3024,  504,  72,  9,  1;
  1, 10, 90, 720, 5040, 30240, 5040, 720, 90, 10,  1;
		

Crossrefs

Cf. this sequence (q=1), A174376 (q=2), A174377 (q=3), A174378 (q=4).

Programs

  • Mathematica
    T[n_, k_, q_]:= If[Floor[n/2]>=k, n!*q^k/(n-k)!, n!*q^(n-k)/k!];
    Table[T[n, k, 1], {n,0,12}, {k,0,n}]//Flatten
  • Sage
    f=factorial
    def T(n,k,q): return f(n)*q^k/f(n-k) if ((n//2)>k-1) else f(n)*q^(n-k)/f(k)
    flatten([[T(n,k,1) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Nov 28 2021

Formula

T(n, k) = n!*q^k/(n-k)! if floor(n/2) > k-1 otherwise n!*q^(n-k)/k!, with q = 1.
T(n, n-k) = T(n, k).
T(2*n, n) = A001813(n). - G. C. Greubel, Nov 28 2021

Extensions

Edited by N. J. A. Sloane, Apr 17 2009