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-10 of 10 results.

A000179 Ménage numbers: a(0) = 1, a(1) = -1, and for n >= 2, a(n) = number of permutations s of [0, ..., n-1] such that s(i) != i and s(i) != i+1 (mod n) for all i.

Original entry on oeis.org

1, -1, 0, 1, 2, 13, 80, 579, 4738, 43387, 439792, 4890741, 59216642, 775596313, 10927434464, 164806435783, 2649391469058, 45226435601207, 817056406224416, 15574618910994665, 312400218671253762, 6577618644576902053, 145051250421230224304, 3343382818203784146955, 80399425364623070680706, 2013619745874493923699123
Offset: 0

Views

Author

Keywords

Comments

According to rook theory, John Riordan considered a(1) to be -1. - Vladimir Shevelev, Apr 02 2010
This is also the value that the formulas of Touchard and of Wyman and Moser give and is compatible with many recurrences. - William P. Orrick, Aug 31 2020
Or, for n >= 3, the number of 3 X n Latin rectangles the second row of which is full cycle with a fixed order of its elements, e.g., the cycle (x_2,x_3,...,x_n,x_1) with x_1 < x_2 < ... < x_n. - Vladimir Shevelev, Mar 22 2010
Muir (p. 112) gives essentially this recurrence (although without specifying any initial conditions). Compare A186638. - N. J. A. Sloane, Feb 24 2011
Sequence discovered by Touchard in 1934. - L. Edson Jeffery, Nov 13 2013
Although these are also known as Touchard numbers, the problem was formulated by Lucas in 1891, who gave the recurrence formula shown below. See Cerasoli et al., 1988. - Stanislav Sykora, Mar 14 2014
An equivalent problem was formulated by Tait; solutions to Tait's problem were given by Muir (1878) and Cayley (1878). - William P. Orrick, Aug 31 2020
From Vladimir Shevelev, Jun 25 2015: (Start)
According to the ménage problem, 2*n!*a(n) is the number of ways of seating n married couples at 2*n chairs around a circular table, men and women in alternate positions, so that no husband is next to his wife.
It is known [Riordan, ch. 7] that a(n) is the number of arrangements of n non-attacking rooks on the positions of the 1's in an n X n (0,1)-matrix A_n with 0's in positions (i,i), i = 1,...,n, (i,i+1), i = 1,...,n-1, and (n,1). This statement could be written as a(n) = per(A_n). For example, A_5 has the form
001*11
1*0011
11001* (1)
11*100
0111*0,
where 5 non-attacking rooks are denoted by {1*}.
We can indicate a one-to-one correspondence between arrangements of n non-attacking rooks on the 1's of a matrix A_n and arrangements of n married couples around a circular table by the rules of the ménage problem, after the ladies w_1, w_2, ..., w_n have taken the chairs numbered
2*n, 2, 4, ..., 2*n-2 (2)
respectively. Suppose we consider an arrangement of rooks: (1,j_1), (2,j_2), ..., (n,j_n). Then the men m_1, m_2, ..., m_n took chairs with numbers
2*j_i - 3 (mod 2*n), (3)
where the residues are chosen from the interval[1,2*n]. Indeed {j_i} is a permutation of 1,...,n. So {2*j_i-3}(mod 2*n) is a permutation of odd positive integers <= 2*n-1. Besides, the distance between m_i and w_i cannot be 1. Indeed, the equality |2*(j_i-i)-1| = 1 (mod 2*n) is possible if and only if either j_i=i or j_i=i+1 (mod n) that correspond to positions of 0's in matrix A_n.
For example, in the case of positions of {1*} in(1) we have j_1=3, j_2=1, j_3=5, j_4=2, j_5=4. So, by(2) and (3) the chairs 1,2,...,10 are taken by m_4, w_2, m_1, w_3, m_5, w_4, m_3, w_5, m_2, w_1, respectively. (End)
The first 20 terms of this sequence were calculated in 1891 by E. Lucas (see [Lucas, p. 495]). - Peter J. C. Moses, Jun 26 2015
From Ira M. Gessel, Nov 27 2018: (Start)
If we invert the formula
Sum_{ n>=0 } u_n z^n = ((1-z)/(1+z)) F(z/(1+z)^2)
that Don Knuth mentions (see link) (i.e., set x=z/(1+z)^2 and solve for z in terms of x), we get a formula for F(z) = Sum_{n >= 0} n! z^n as a sum with all positive coefficients of (almost) powers of the Catalan number generating function.
The exact formula is (5) of the Yiting Li article.
This article also gives a combinatorial proof of this formula (though it is not as simple as one might want). (End)

Examples

			a(2) = 0; nothing works. a(3) = 1; (201) works. a(4) = 2; (2301), (3012) work. a(5) = 13; (20413), (23401), (24013), (24103), (30412), (30421), (34012), (34021), (34102), (40123), (43012), (43021), (43102) work.
		

References

  • W. W. R. Ball and H. S. M. Coxeter, Mathematical Recreations and Essays, 13th Ed. Dover, p. 50.
  • M. Cerasoli, F. Eugeni and M. Protasi, Elementi di Matematica Discreta, Nicola Zanichelli Editore, Bologna 1988, Chapter 3, p. 78.
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 185, mu(n).
  • Kaplansky, Irving and Riordan, John, The probleme des menages, Scripta Math. 12, (1946). 113-124. See u_n.
  • E. Lucas, Théorie des nombres, Paris, 1891, pp. 491-495.
  • P. A. MacMahon, Combinatory Analysis. Cambridge Univ. Press, London and New York, Vol. 1, 1915 and Vol. 2, 1916; see vol. 1, p 256.
  • T. Muir, A Treatise on the Theory of Determinants. Dover, NY, 1960, Sect. 132, p. 112. - N. J. A. Sloane, Feb 24 2011
  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 197.
  • V. S. Shevelev, Reduced Latin rectangles and square matrices with equal row and column sums, Diskr. Mat. (J. of the Akademy of Sciences of Russia) 4(1992), 91-110. - Vladimir Shevelev, Mar 22 2010
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • H. M. Taylor, A problem on arrangements, Mess. Math., 32 (1902), 60ff.
  • J. Touchard, Permutations discordant with two given permutations, Scripta Math., 19 (1953), 108-119.
  • J. H. van Lint, Combinatorial Theory Seminar, Eindhoven University of Technology, Springer Lecture Notes in Mathematics, Vol. 382, 1974. See page 10.

Crossrefs

Diagonal of A058087. Also a diagonal of A008305.
A000179, A102761, and A335700 are all essentially the same sequence but with different conventions for the initial terms a(0) and a(1). - N. J. A. Sloane, Aug 06 2020

Programs

  • Haskell
    import Data.List (zipWith5)
    a000179 n = a000179_list !! n
    a000179_list = 1 : -1 : 0 : 1 : zipWith5
       (\v w x y z -> (x * y + (v + 2) * z - w) `div` v) [2..] (cycle [4,-4])
       (drop 4 a067998_list) (drop 3 a000179_list) (drop 2 a000179_list)
    -- Reinhard Zumkeller, Aug 26 2013
    
  • Maple
    A000179:= n ->add ((-1)^k*(2*n)*binomial(2*n-k,k)*(n-k)!/(2*n-k), k=0..n); # for n >= 1
    U:= proc(n) local k; 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; A000179 := n->W(n,0); # valid for n >= 1
  • Mathematica
    a[n_] := 2*n*Sum[(-1)^k*Binomial[2*n - k, k]*(n - k)!/(2*n - k), {k, 0, n}]; a[0] = 1; Table[a[n], {n, 0, 21}] (* Jean-François Alcover, Dec 05 2012, from 2nd formula *)
  • PARI
    \\ 3 programs adapted to a(1) = -1 by Hugo Pfoertner, Aug 31 2020
    
  • PARI
    {a(n) = my(A); if( n, A = vector(n,i,i-2); for(k=4, n, A[k] = (k * (k - 2) * A[k-1] + k * A[k-2] - 4 * (-1)^k) / (k-2)); A[n], 1)};/* Michael Somos, Jan 22 2008 */
    
  • PARI
    a(n)=if(n>1, round(2*n*exp(-2)*besselk(n, 2)), 1-2*n) \\ Charles R Greathouse IV, Nov 03 2014
    
  • PARI
    {a(n) = my(A); if( n, A = vector(n,i,i-2); for(k=5, n, A[k] = k * A[k-1] + 2 * A[k-2] + (4-k) * A[k-3] - A[k-4]); A[n], 1)} /* Michael Somos, May 02 2018 */
    
  • Python
    from math import comb, factorial
    def A000179(n): return 1 if n == 0 else sum((-2*n if k & 1 else 2*n)*comb(m:=2*n-k,k)*factorial(n-k)//m for k in range(n+1)) # Chai Wah Wu, May 27 2022

Formula

a(n) = ((n^2-2*n)*a(n-1) + n*a(n-2) - 4*(-1)^n)/(n-2) for n >= 3.
a(n) = A059375(n)/(2*n!) for n >= 2.
a(n) = Sum_{k=0..n} (-1)^k*(2*n)*binomial(2*n-k, k)*(n-k)!/(2*n-k) for n >= 1. - Touchard (1934)
G.f.: ((1-x)/(1+x))*Sum_{n>=0} n!*(x/(1+x)^2)^n. - Vladeta Jovovic, Jun 26 2007
a(2^k+2) == 0 (mod 2^k); for k >= 2, a(2^k) == 2(mod 2^k). - Vladimir Shevelev, Jan 14 2011
a(n) = round( 2*n*exp(-2)*BesselK(n,2) ) for n > 1. - Mark van Hoeij, Oct 25 2011
a(n) ~ (n/e)^n * sqrt(2*Pi*n)/e^2. - Charles R Greathouse IV, Jan 21 2016
0 = a(n)*(-a(n+2) +a(n+4)) +a(n+1)*(+a(n+1) +a(n+2) -3*a(n+3) -5*a(n+4) +a(n+5)) +a(n+2)*(+2*a(n+2) +3*a(n+3) -3*a(n+4)) +a(n+3)*(+2*a(n+3) +a(n+4) -a(n+5)) +a(n+4)*(+a(n+4)), for all n>1. If a(-2..1) = (0, -1, 2, -1) then also true for those values of n. - Michael Somos, Apr 29 2018
D-finite with recurrence: 0 = a(n) +n*a(n+1) -2*a(n+2) +(-n-4)*a(n+3) +a(n+4), for all n in Z where a(n) = a(-n) for all n in Z and a(0) = 2, a(1) = -1. - Michael Somos, May 02 2018
a(n) = Sum_{k=0..n} A213234(n,k) * A000023(n-2*k) = Sum_{k=0..n} (-1)^k * n/(n-k) * binomial(n-k, k) * (n-2*k)! Sum_{j=0..n-2*k} (-2)^j/j! for n >= 1. [Wyman and Moser (1958)]. - William P. Orrick, Jun 25 2020
a(k+4*p) - 2*a(k+2*p) + a(k) is divisible by p, for any k > 0 and any prime p. - Mark van Hoeij, Jan 11 2022

Extensions

More terms from James Sellers, May 02 2000
Additional comments from David W. Wilson, Feb 18 2003
a(1) changed to -1 at the suggestion of Don Knuth. - N. J. A. Sloane, Nov 26 2018

A090301 a(n) = 15*a(n-1) + a(n-2), starting with a(0) = 2 and a(1) = 15.

Original entry on oeis.org

2, 15, 227, 3420, 51527, 776325, 11696402, 176222355, 2655031727, 40001698260, 602680505627, 9080209282665, 136805819745602, 2061167505466695, 31054318401746027, 467875943531657100, 7049193471376602527
Offset: 0

Views

Author

Nikolay V. Kosinov (kosinov(AT)unitron.com.ua), Jan 25 2004

Keywords

Comments

Lim_{n-> infinity} a(n)/a(n+1) = 0.066372... = 2/(15+sqrt(229)) = (sqrt(229)-15)/2.
Lim_{n-> infinity} a(n+1)/a(n) = 15.066372... = (15+sqrt(229))/2 = 2/(sqrt(229)-15).
For more information about this type of recurrence follow the Khovanova link and see A054413, A086902 and A178765. - Johannes W. Meijer, Jun 12 2010

Examples

			a(4) = 15*a(3) + a(2) = 15*3420 + 227 = ((15+sqrt(229))/2)^4 + ((15-sqrt(229))/2)^4 = 51526.9999805 + 0.0000194 = 51527.
		

Crossrefs

Lucas polynomials: A114525.
Lucas polynomials Lucas(n,m): A000032 (m=1), A002203 (m=2), A006497 (m=3), A014448 (m=4), A087130 (m=5), A085447 (m=6), A086902 (m=7), A086594 (m=8), A087798 (m=9), A086927 (m=10), A001946 (m=11), A086928 (m=12), A088316 (m=13), A090300 (m=14), this sequence (m=15), A090305 (m=16), A090306 (m=17), A090307 (m=18), A090308 (m=19), A090309 (m=20), A090310 (m=21), A090313 (m=22), A090314 (m=23), A090316 (m=24), A330767 (m=25), A087281 (m=29), A087287 (m=76), A089772 (m=199).

Programs

  • GAP
    m:=15;; a:=[2,m];; for n in [3..20] do a[n]:=m*a[n-1]+a[n-2]; od; a; # G. C. Greubel, Dec 31 2019
  • Magma
    m:=15; I:=[2,m]; [n le 2 select I[n] else m*Self(n-1) +Self(n-2): n in [1..20]]; // G. C. Greubel, Dec 31 2019
    
  • Maple
    seq(simplify(2*(-I)^n*ChebyshevT(n, 15*I/2)), n = 0..20); # G. C. Greubel, Dec 31 2019
  • Mathematica
    LucasL[Range[20]-1, 15] (* G. C. Greubel, Dec 31 2019 *)
  • PARI
    vector(21, n, 2*(-I)^(n-1)*polchebyshev(n-1, 1, 15*I/2) ) \\ G. C. Greubel, Dec 31 2019
    
  • Sage
    [2*(-I)^n*chebyshev_T(n, 15*I/2) for n in (0..20)] # G. C. Greubel, Dec 31 2019
    

Formula

a(n) = 15*a(n-1) + a(n-2), starting with a(0) = 2 and a(1) = 15.
a(n) = ((15+sqrt(229))/2)^n + ((15-sqrt(229))/2)^n.
(a(n))^2 = a(2n) - 2 if n=1, 3, 5...
(a(n))^2 = a(2n) + 2 if n=2, 4, 6...
G.f.: (2-15*x)/(1-15*x-x^2). - Philippe Deléham, Nov 02 2008
Contribution from Johannes W. Meijer, Jun 12 2010: (Start)
Lim_{k-> infinity} a(n+k)/a(k) = (A090301(n) + A154597(n)*sqrt(229))/2.
Lim_{n-> infinity} A090301(n)/ A154597(n) = sqrt(229).
a(2n+1) = 15*A098246(n).
a(3n+1) = A041426(5n), a(3n+2) = A041426(5n+3), a(3n+3) = 2*A041426(5n+4).
(End)
a(n) = Lucas(n, 15) = 2*(-i)^n * ChebyshevT(n, 15*i/2). - G. C. Greubel, Dec 31 2019
E.g.f.: 2*exp(15*x/2)*cosh(sqrt(229)*x/2). - Stefano Spezia, Jan 01 2020

Extensions

More terms from Ray Chandler, Feb 14 2004

A000425 Coefficients of ménage hit polynomials.

Original entry on oeis.org

2, 0, 0, 8, 30, 192, 1344, 10800, 97434, 976000, 10749024, 129103992, 1679495350, 23525384064, 353028802560, 5650370001120, 96082828074162, 1729886440780800, 32874134679574208, 657589108734075240, 13811277748363437006, 303884178002526338624
Offset: 1

Views

Author

Keywords

References

  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 197.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A diagonal of A058087. Cf. A000179.

Programs

  • Mathematica
    p[n_] := Sum[2*n/(2*n-k)*Binomial[2*n-k, k]*(n-k)!*(x-1)^k, {k, 0, n}] // CoefficientList[#, x]&; Array[p, 25][[All, 2]] (* Jean-François Alcover, Feb 08 2016 *)

Formula

It appears that a(n) = round(4*n*exp(-2)*(BesselK(n-1,2)+BesselK(n,2))) when n >= 10. - Mark van Hoeij, Oct 25 2011
Conjecture: (n-1)*(n-3)*a(n) -n*(n-2)*(n-3)*a(n-1) -n*(n-1)*(n-3)*a(n-2) -n *(n-1)*a(n-3)=0. - R. J. Mathar, Nov 02 2015
Conjecture: a(n) = 2*n*A000271(n). - R. J. Mathar, Nov 02 2015

A000033 Coefficients of ménage hit polynomials.

Original entry on oeis.org

0, 2, 3, 4, 40, 210, 1477, 11672, 104256, 1036050, 11338855, 135494844, 1755206648, 24498813794, 366526605705, 5851140525680, 99271367764480, 1783734385752162, 33837677493828171, 675799125332580020, 14173726082929399560, 311462297063636041906
Offset: 1

Views

Author

Keywords

References

  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 197.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A diagonal of A058087.

Programs

  • Haskell
    fac = a000142
    a n = sum $ map f [2..n]
      where f k = g k `div` h k
            g k = (-1)^k * n * fac (2*n-k-1) * fac (n-k)
            h k = fac (2*n-2*k) * fac (k-2)
    -- James Spahlinger, Oct 08 2012
    
  • Magma
    [0] cat [&+[(-1)^k*n*Factorial(2*n-k-1)*Factorial(n-k)/(Factorial(2*n-2*k)*Factorial(k-2)): k in [2..n]]: n in [2..25]]; // Vincenzo Librandi, Jun 11 2019
    
  • Mathematica
    Table[n*Sum[(-1)^k*(2*n-k-1)!*(n-k)!/((2*n-2*k)!*(k-2)!),{k,2,n}],{n,1,20}] (* Vaclav Kotesovec, Oct 26 2012 *)
  • SageMath
    def A000033(n): return n*sum((-1)^k*(2*n-3-2*k)*factorial(n-k-2)*binomial(2*n-k-3, k) for k in range(n-1)) # G. C. Greubel, Jul 10 2025

Formula

a(n) = coefficient of t^2 in polynomial p(t) = Sum_{k=0..n} 2*n*C(2*n-k,k)*(n-k)!*(t-1)^k/(2*n-k).
a(n) = Sum_{k=2..n} (-1)^k*n*(2*n-k-1)!*(n-k)!/((2*n-2*k)!*(k-2)!). - David W. Wilson, Jun 22 2006
a(n) = n*A000426(n) - Vladeta Jovovic, Dec 27 2007
Recurrence: (n-3)*(n-2)*(2*n-5)*(2*n-7)*a(n) = (n-3)*(n-2)*n*(2*n-7)^2*a(n-1) + (n-4)*(n-3)*n*(2*n-3)^2*a(n-2) + (n-2)*n*(2*n-5)*(2*n-3)*a(n-3). - Vaclav Kotesovec, Oct 26 2012
a(n) ~ 2/e^2*n!. - Vaclav Kotesovec, Oct 26 2012
From Mark van Hoeij, Jun 09 2019: (Start)
a(n) = round(2*(exp(-2)*n*(4*BesselK(n,2) - (2*n-5)*BesselK(n-1,2)) - (-1)^n)), for n > 9.
a(n) = (3/2)*(A000159(n+1)*n/(n+1) - A000159(n))/(n-1) for n > 2. (End)
Conjecture: a(n) + 2*a(n+p) + a(n+2*p) is divisible by p for any prime p. - Mark van Hoeij, Jun 10 2019

Extensions

Extended to 34 terms by N. J. A. Sloane, May 25 2005
Edited and further extended by David W. Wilson, Dec 27 2007

A000159 Coefficients of ménage hit polynomials.

Original entry on oeis.org

2, 8, 20, 152, 994, 7888, 70152, 695760, 7603266, 90758872, 1174753372, 16386899368, 245046377410, 3910358788256, 66323124297872, 1191406991067168, 22596344660865282, 451208920617687720, 9461897733571886372, 207894669895136763704, 4776019866458134139042
Offset: 3

Views

Author

Keywords

References

  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 197.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A diagonal of A058087.

Formula

Conjecture: 2*(-252307*n + 1041077)*a(n) + (504614*n^2 - 3362985*n + 5118150)*a(n-1) + (1280831*n^2 - 7397886*n + 6461565)*a(n-2) + (746598*n^2 - 2913543*n - 1336090)*a(n-3) + (-405481*n^2 + 6175011*n - 15469320)*a(n-4) + (-375862*n^2 + 4098537*n - 8846430)*a(n-5) + 2*(-187931*n + 560630)*a(n-6) = 0. - R. J. Mathar, Nov 02 2015
a(n) = round(2*n*(4*exp(-2)*((n+3/2)*BesselK(n-1,2) - (n-9/2)*BesselK(n-2,2)) + (-1)^n)/3) for n > 11 assuming the recurrence is correct. - Mark van Hoeij, Jun 09 2019
Conjecture: a(n) + 2*a(n+p) + a(n+2*p) is divisible by p for any prime p except 3. - Mark van Hoeij, Jun 10 2019

A000181 Coefficients of ménage hit polynomials.

Original entry on oeis.org

2, 15, 60, 469, 3660, 32958, 328920, 3614490, 43341822, 563144725, 7880897892, 118177520295, 1890389939000, 32130521850972, 578260307815920, 10985555094348948, 219687969344126490, 4613039009310624795, 101479234383619208204, 2333872309936442446905
Offset: 4

Views

Author

Keywords

References

  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 197.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A diagonal of A058087. Cf. A000179, A000425.

Formula

Conjecture: 3*(2111*n-8303)*(n-4)*(-9+2*n)^2*a(n) - (n-3)*(25332*n^4 - 377236*n^3 + 1898681*n^2 - 3320738*n + 484000)*a(n-1) - 2*(n-4)*(12140*n^4 - 118152*n^3 + 337063*n^2 - 377436*n + 225720)*a(n-2) + (1052*n^5 - 40656*n^4 + 266063*n^3 - 549153*n^2 + 49850*n + 655200)*a(n-3) +(263*n+640)*(n-3)*(-7+2*n)^2*a(n-4) = 0. - R. J. Mathar, Nov 02 2015
Conjecture: a(n) + 2*a(n+p) + a(n+2*p) is divisible by p for any prime p > 3. - Mark van Hoeij, Jun 10 2019

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).

Original entry on oeis.org

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, 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

N. J. A. Sloane, based on a suggestion from Anthony C Robin, Jun 02 2004

Keywords

Comments

The men and women alternate.

Examples

			Triangle begins:
     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,   2;
   579,  1344,  1477,  994,  469,  140,  35,  2;
  4738, 10800, 11672, 7888, 3660, 1232, 280, 48, 2;
  ...
		

References

  • I. Kaplansky and J. Riordan, The problème des ménages, Scripta Math. 12, (1946), 113-124. See Table 1.
  • 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.

Crossrefs

Essentially a mirror image of A058087, which has much more information.
Diagonals give A000179, A000425, A000033, A000159, A000181, etc.

Programs

  • Mathematica
    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}]];
    Table[T[n, k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, May 15 2021 *)
  • Sage
    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) )
    flatten([[A094314(n,k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, May 15 2021

Formula

Sum_{k=0..n} T(n,k) = n!.
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

A000185 Coefficients of ménage hit polynomials.

Original entry on oeis.org

2, 24, 140, 1232, 11268, 115056, 1284360, 15596208, 204710454, 2888897032, 43625578836, 702025263328, 11993721979336, 216822550325472, 4135337882588880, 82986434235959712, 1747976804189353962, 38559791049947726328, 889047923669760546140
Offset: 5

Views

Author

Keywords

References

  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 197.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A diagonal of A058087. Cf. A000179, A000425.

Formula

Conjecture: +4*(210968408*n^2 -1603518486*n +2343057493) *a(n) +(-843873632*n^3 -4039256254*n^2 +144382575631*n -553812368850) *a(n-1) +(10453330198*n^3 -175111274403*n^2 +798927275864*n -639098546595) *a(n-2) +(10059264970*n^3 -98879552663*n^2 +170576803994*n -134993524720) *a(n-3) +(470894110*n^3 -5178116941*n^2 +108179055193*n -215961878286) *a(n-4) +(1708832970*n^3 -29554327949*n^2 +137453332457*n -152801514054) *a(n-5) +3*(569610990*n^2 -3742686463*n +4740040723) *a(n-6)=0. - R. J. Mathar, Nov 02 2015
Conjecture: (241*n-1066) *(2*n-11) *(-5+n)^2 *a(n) +(-482*n^5 +10099*n^4 -79756*n^3 +285961*n^2 -426904*n +149292) *a(n-1) -(2*n-9) *(n-3) *(248*n^3 -2229*n^2 +5065*n -7134) *a(n-2) +(-14*n^5 -49*n^4 -619*n^3 +13174*n^2 -51690*n +61248) *a(n-3) -(n-3) *(n-4) *(7*n-87) *(2*n-7) *a(n-4)= 0. - R. J. Mathar, Nov 02 2015
a(n)+2*a(n+p)+a(n+2*p) is divisible by p for any prime except 3 and 5. - Mark van Hoeij, Jun 13 2019

A058089 Coefficients of ménage hit polynomials.

Original entry on oeis.org

2, 35, 280, 2856, 30300, 349734, 4351368, 58217640, 834296862, 12759002305, 207501063952, 3577028170736, 65167077604440, 1251273416561196, 25258559758736880, 534813397441926960, 11852765770416416538, 274422835213034666655
Offset: 6

Views

Author

N. J. A. Sloane, Dec 02 2000

Keywords

References

  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 197.

Crossrefs

A diagonal of A058087. Cf. A000179, A000425.

A058090 Coefficients of ménage hit polynomials.

Original entry on oeis.org

2, 48, 504, 6000, 73260, 951984, 13152984, 193295952, 3016469790, 49879061920, 871884630672, 16072938332064, 311769325656312, 6349343550308640, 135485465497382160, 3023380765038115680, 70429101211136913498, 1709801309366361996624
Offset: 7

Views

Author

N. J. A. Sloane, Dec 02 2000

Keywords

References

  • J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 197.

Crossrefs

A diagonal of A058087. Cf. A000179, A000425.
Showing 1-10 of 10 results.