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.
%I A094314 #32 May 17 2021 04:33:27 %S A094314 1,0,1,0,0,2,1,0,3,2,2,8,4,8,2,13,30,40,20,15,2,80,192,210,152,60,24, %T A094314 2,579,1344,1477,994,469,140,35,2,4738,10800,11672,7888,3660,1232,280, %U A094314 48,2,43387,97434,104256,70152,32958,11268,2856,504,63,2,439792,976000,1036050,695760,328920,115056,30300,6000,840,80,2 %N A094314 Triangle read by rows: T(n,k) = number of ways of seating n couples around a circular table so that exactly k married couples are adjacent (0 <= k <= n). %C A094314 The men and women alternate. %D A094314 I. Kaplansky and J. Riordan, The problème des ménages, Scripta Math. 12, (1946), 113-124. See Table 1. %D A094314 Tolman, L. Kirk, "Extensions of derangements", Proceedings of the West Coast Conference on Combinatorics, Graph Theory and Computing, Humboldt State University, Arcata, California, September 5-7, 1979. Vol. 26. Utilitas Mathematica Pub., 1980. See Table I. %H A094314 Alois P. Heinz, <a href="/A094314/b094314.txt">Rows n = 0..140, flattened</a> %H A094314 I. Kaplansky and J. Riordan, <a href="/A000166/a000166_1.pdf">The problème des ménages</a>, Scripta Math. 12, (1946), 113-124. [Scan of annotated copy] %H A094314 Anthony C. Robin, <a href="http://www.jstor.org/stable/40378205">90.72 Circular Wife Swapping</a>, The Mathematical Gazette, Vol. 90, No. 519 (Nov., 2006), pp. 471-478. %H A094314 L. Takacs, <a href="http://dx.doi.org/10.1016/S0012-365X(81)80024-6">On the probleme des menages</a>, Discr. Math. 36 (3) (1981) 289-297, Table 1. %F A094314 Sum_{k=0..n} T(n,k) = n!. %F A094314 T(n, k) = Sum_{j=0..n-k} (-1)^j*(2*n*(n-k-j)!/(2*n-k-j))*binomial(k+j, k) * binomial(2*n-k-j, k+j) for n > 1, T(0, 0) = T(1, 1) = 1, and T(1, 0) = 0. - _G. C. Greubel_, May 15 2021 %e A094314 Triangle begins: %e A094314 1; %e A094314 0, 1; %e A094314 0, 0, 2; %e A094314 1, 0, 3, 2; %e A094314 2, 8, 4, 8, 2; %e A094314 13, 30, 40, 20, 15, 2; %e A094314 80, 192, 210, 152, 60, 24, 2; %e A094314 579, 1344, 1477, 994, 469, 140, 35, 2; %e A094314 4738, 10800, 11672, 7888, 3660, 1232, 280, 48, 2; %e A094314 ... %t A094314 T[n_, k_]:= If[n<2, (1+(-1)^(n-k))/2, Sum[(-1)^j*(2*n*(n-k-j)!/(2*n-k-j))* Binomial[k+j, k]*Binomial[2*n-k-j, k+j], {j, 0, n-k}]]; %t A094314 Table[T[n, k], {n,0,12}, {k,0,n}]//Flatten (* _G. C. Greubel_, May 15 2021 *) %o A094314 (Sage) %o A094314 def A094314(n,k): return (1+(-1)^(n+k))/2 if (n<2) else sum( (-1)^j*(2*n*factorial(n-k-j)/(2*n-k-j))*binomial(k+j, k)*binomial(2*n-k-j, k+j) for j in (0..n-k) ) %o A094314 flatten([[A094314(n,k) for k in (0..n)] for n in (0..12)]) # _G. C. Greubel_, May 15 2021 %Y A094314 Essentially a mirror image of A058087, which has much more information. %Y A094314 Diagonals give A000179, A000425, A000033, A000159, A000181, etc. %K A094314 nonn,tabl %O A094314 0,6 %A A094314 _N. J. A. Sloane_, based on a suggestion from _Anthony C Robin_, Jun 02 2004