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.

Showing 1-2 of 2 results.

A058087 Triangle read by rows, giving coefficients of the ménage hit polynomials ordered by descending powers. T(n, k) for 0 <= k <= n.

Original entry on oeis.org

1, 2, -1, 2, 0, 0, 2, 3, 0, 1, 2, 8, 4, 8, 2, 2, 15, 20, 40, 30, 13, 2, 24, 60, 152, 210, 192, 80, 2, 35, 140, 469, 994, 1477, 1344, 579, 2, 48, 280, 1232, 3660, 7888, 11672, 10800, 4738, 2, 63, 504, 2856, 11268, 32958, 70152, 104256, 97434, 43387
Offset: 0

Views

Author

N. J. A. Sloane, Dec 02 2000

Keywords

Comments

Riordan's book (page 197) notes that an alternative convention is to put 2 in the first row of the triangle. - William P. Orrick, Aug 09 2020

Examples

			The triangle begins:
  1;
  2, -1;
  2,  0,   0;
  2,  3,   0,    1;
  2,  8,   4,    8,     2;
  2, 15,  20,   40,    30,    13;
  2, 24,  60,  152,   210,   192,    80;
  2, 35, 140,  469,   994,  1477,  1344,    579;
  2, 48, 280, 1232,  3660,  7888, 11672,  10800,  4738;
  2, 63, 504, 2856, 11268, 32958, 70152, 104256, 97434, 43387;
The polynomials start:
  [0] 1;
  [1] 2*x - 1;
  [2] 2*x^2;
  [3] 2*x^3 + 3*x^2 + 1;
  [4] 2*x^4 + 8*x^3 + 4*x^2 + 8*x + 2;
  [5] 2*x^5 + 15*x^4 + 20*x^3 + 40*x^2 + 30*x + 13.
		

References

  • I. Kaplansky and J. Riordan, The probleme des menages, Scripta Mathematica, 1946, 12 (2), 113-124.
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 198.
  • 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. - N. J. A. Sloane, Jul 06 2014

Crossrefs

Essentially a mirror image of A094314.

Programs

  • Maple
    U := proc(n) if n = 0 then return 1 fi;
    add((2*n/(2*n-k))*binomial(2*n-k, k)*(n-k)!*(x-1)^k, k=0..n) end:
    W := proc(r, s) coeff(U(r), x, s ) end:
    T := (n, k) -> W(n, n-k): seq(seq(T(n, k), k=0..n), n=0..9);
  • Mathematica
    u[n_] := Sum[ 2*n/(2*n-k)*Binomial[2*n-k, k]*(n-k)!*(x-1)^k, {k, 0, n}]; w[r_, s_] := Coefficient[u[r], x, s]; a[n_, k_] := w[n, n-k]; a[0, 0]=1; Table[a[n, k], {n, 0, 9}, {k, 0, n}] // Flatten (* Jean-François Alcover, Sep 10 2012, translated from Maple *)
    T[n_, k_]:= If[n==0, 1, Sum[(-1)^j*(2*n*(k-j)!/(n+k-j))*Binomial[j+n-k, n - k]*Binomial[n+k-j, n-k+j], {j, 0, k}]];
    Table[T[n,k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, May 15 2021 *)
  • PARI
    U(n,t)=sum(k=0,n, ((2*n/(2*n-k))*binomial(2*n-k,k)*(n-k)!*(t-1)^k));
    print1(1,", "); for(n=1,9,forstep(k=n,0,-1,print1(polcoef(U(n,'x),k),", "))) \\ Hugo Pfoertner, Aug 30 2020
  • Sage
    def A058087(n,k): return 1 if (n==0) else sum( (-1)^j*(2*n*factorial(k-j)/(n+k-j))*binomial(j+n-k, n-k)*binomial(n+k-j, n-k+j) for j in (0..k) )
    flatten([[A058087(n,k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, May 15 2021
    
  • SageMath
    a = [[1]]
    for n in range(1, 10):
        g = expand(
            sum((x - 1)^ k * (2*n) * binomial(2*n-k, k) * factorial(n-k) / (2*n-k)
                for k in range(0, n + 1)
            )
        )
        coeffs = g.coefficients(sparse=False)
        coeffs.reverse()
        a.append(coeffs) # William P. Orrick, Aug 12 2020
    

Formula

G.f.: (1-x*(y-1))*Sum_{n>=0} ( n!*(x*y)^n/(1+x*(y-1))^(2*n+1) ). - Vladeta Jovovic, Dec 14 2009
Row n of the triangle lists the coefficients of the polynomial U_n(t) = Sum_{k=0..n} (2*n/(2*n-k))*binomial(2*n-k,k)*(n-k)!*(t-1)^k, with higher order terms first (Kaplansky and Riordan). - William P. Orrick, Aug 09 2020
T(n, k) = Sum_{j=0..k} (-1)^j*(2*n*(k-j)!/(n+k-j))*binomial(n-k+j, n-k)*binomial(n+k-j, n-k+j), with T(0, k) = 1. - G. C. Greubel, May 15 2021 [Corrected by Sean A. Irvine, Jul 23 2022]

Extensions

T(1,1) set to -1 to accord with Riordan by William P. Orrick, Aug 09 2020

A156996 Triangle T(n, k) = coefficients of p(n,x), where p(n,x) = Sum_{j=0..n} (2*n*(n-j)!/(2*n-j)) * binomial(2*n-j, j) * (x-1)^j and p(0,x) = 1, read by rows.

Original entry on oeis.org

1, -1, 2, 0, 0, 2, 1, 0, 3, 2, 2, 8, 4, 8, 2, 13, 30, 40, 20, 15, 2, 80, 192, 210, 152, 60, 24, 2, 579, 1344, 1477, 994, 469, 140, 35, 2, 4738, 10800, 11672, 7888, 3660, 1232, 280, 48, 2, 43387, 97434, 104256, 70152, 32958, 11268, 2856, 504, 63, 2, 439792, 976000, 1036050, 695760, 328920, 115056, 30300, 6000, 840, 80, 2
Offset: 0

Views

Author

Roger L. Bagula, Feb 20 2009

Keywords

Examples

			Triangle begins as:
       1;
      -1,      2;
       0,      0,       2;
       1,      0,       3,      2;
       2,      8,       4,      8,      2;
      13,     30,      40,     20,     15,      2;
      80,    192,     210,    152,     60,     24,     2;
     579,   1344,    1477,    994,    469,    140,    35,    2;
    4738,  10800,   11672,   7888,   3660,   1232,   280,   48,   2;
   43387,  97434,  104256,  70152,  32958,  11268,  2856,  504,  63,  2;
  439792, 976000, 1036050, 695760, 328920, 115056, 30300, 6000, 840, 80, 2;
		

References

  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, pp. 197-199

Crossrefs

Programs

  • Magma
    A156996:= func< n,k | n eq 0 select 1 else (&+[(-1)^(j-k)*(2*n*Factorial(n-j)/(2*n-j))*Binomial(j, k)*Binomial(2*n-j, j): j in [k..n]]) >;
    [A156996(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, May 14 2021
    
  • Mathematica
    (* first program *)
    Table[CoefficientList[If[n==0, 1, Sum[Binomial[2*n-k, k]*(n-k)!*(2*n/(2*n-k))*(x- 1)^k, {k,0,n}]], x], {n,0,12}]//Flatten
    (* Second program *)
    T[n_, k_]:= If[n==0, 1, Sum[(-1)^(j-k)*(2*n*(n-j)!/(2*n-j))*Binomial[j, k]*Binomial[2*n-j, j], {j,k,n}]];
    Table[T[n, k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, May 14 2021 *)
  • Sage
    def A156996(n,k): return 1 if (n==0) else sum( (-1)^(j-k)*(2*n*factorial(n-j)/(2*n-j))*binomial(j, k)*binomial(2*n-j, j) for j in (k..n) )
    flatten([[A156996(n,k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, May 14 2021

Formula

T(n, k) = coefficients of p(n,x), where p(n,x) = Sum_{j=0..n} (2*n*(n-j)!/(2*n-j)) * binomial(2*n-j, j) * (x-1)^j and p(0,x) = 1.
Sum_{k=0..n} T(n, k) = n!.
From G. C. Greubel, May 14 2021: (Start)
T(n, 0) = A000179(n).
T(n, k) = Sum_{j=k..n} (-1)^(j+k)*(2*n*(n-j)!/(2*n-j))*binomial(j, k)*binomial(2*n-j, j), with T(0, k) = 1. (End)

Extensions

Edited by G. C. Greubel, May 14 2021
Showing 1-2 of 2 results.