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.

A193639 Triangle T(n,k) of ways n couples can sit in a row with exactly k of them together.

Original entry on oeis.org

1, 0, 2, 8, 8, 8, 240, 288, 144, 48, 13824, 15744, 8064, 2304, 384, 1263360, 1401600, 710400, 211200, 38400, 3840, 168422400, 183582720, 92620800, 28108800, 5529600, 691200, 46080, 30865121280, 33223034880, 16717639680, 5148057600, 1061222400, 149022720, 13547520, 645120
Offset: 0

Views

Author

Andrew Woods, Aug 01 2011

Keywords

Comments

Row n sums to (2*n)!.
Dot product of row n and (0,1,2,3,...n) is equal to (2*n)!, for n > 0.
Dot product of row n and (0,0,1,2,...n-1) is equal to T(n,0), for n > 0.

Examples

			Triangle begins:
  1
  0 2
  8 8 8
  240 288 144 48
  13824 15744 8064 2304 384
There are T(3, 2) = 144 ways to arrange three couples in a row so that exactly two of them are together.
		

Programs

  • Mathematica
    Table[Table[Sum[(-1)^k Binomial[n-i,k](2n-i-k)! 2^(k+i),{k,0,n-i}]*Binomial[n,i],{i,0,n}],{n,0,10}]//Grid (* Geoffrey Critzer, Apr 21 2014 *)

Formula

T(n, k) = 2*(2*n-k)*T(n-1, k-1) + ((2*n-1-k)*(2*n-2-k)+2*k)*T(n-1, k) + 2*(k+1)*(2*n-2-k)*T(n-1, k+1) + (k+2)*(k+1)*T(n-1, k+2).
T(n, n) = 2^n * n! = (2*n)!!.
T(n, k) = Sum_{i=k..n} (-1)^(i-k) * 2^i * (2*n-i)! * binomial(n, i) * binomial(i, k).
T(n, 0) = A007060(n).
T(n, n) = A000165(n).