Original entry on oeis.org
1, 0, 0, 2, 24, 552, 21280, 103760, 70299264, 5792853248, 587159944704, 71822743499520
Offset: 0
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
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.
- 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.
- Seiichi Manyama, Table of n, a(n) for n = 0..450 (terms 0..100 from T. D. Noe)
- M. A. Alekseyev, Weighted de Bruijn Graphs for the Menage Problem and Its Generalizations. Lecture Notes in Computer Science 9843 (2016), 151-162. doi:10.1007/978-3-319-44543-4_12 arXiv:1510.07926, [math.CO], 2015-2016.
- Vladimir Baltic, On the number of certain types of strongly restricted permutations, Applicable Analysis and Discrete Mathematics Vol. 4, No 1 (April, 2010), 119-135.
- Kenneth P. Bogart and Peter G. Doyle, Nonsexist solution of the ménage problem, Amer. Math. Monthly 93 (1986), no. 7, 514-519.
- A. Cayley, On a problem of arrangements, Proceedings of the Royal Society of Edinburgh 9 (1878) 338-342.
- A. Cayley, On a problem of arrangements, Proceedings of the Royal Society of Edinburgh 9 (1878) 338-342.
- A. Cayley, On Mr Muir's discussion of Professor Tait's problem of arrangements, Proceedings of the Royal Society of Edinburgh 9 (1878) 388-391.
- A. Cayley, On Mr Muir's discussion of Professor Tait's problem of arrangements, Proceedings of the Royal Society of Edinburgh 9 (1878) 388-391.
- J. Dutka, On the Probleme des Menages, Mathem. Conversat. (2001) 277-287, reprinted from Math. Intell. 8 (1986) 18-25
- A. de Gennaro, How many latin rectangles are there?, arXiv:0711.0527 [math.CO] (2007), see p. 2.
- P. Flajolet and R. Sedgewick, Analytic Combinatorics, 2009; see page 372
- Nick Hobson, Python program for this sequence.
- Peter Kagey, Ranking and Unranking Restricted Permutations, arXiv:2210.17021 [math.CO], 2022.
- Irving Kaplansky, Solution of the "Problème des ménages", Bull. Amer. Math. Soc. 49, (1943). 784-785.
- Irving Kaplansky, Symbolic solution of certain problems in permutations, Bull. Amer. Math. Soc., 50 (1944), 906-914.
- I. Kaplansky and J. Riordan, The problème des ménages, Scripta Math. 12, (1946), 113-124. [Scan of annotated copy]
- S. M. Kerawala, Asymptotic solution of the "Probleme des menages, Bull. Calcutta Math. Soc., 39 (1947), 82-84. [Annotated scanned copy]
- Vaclav Kotesovec, Non-attacking chess pieces, 6ed, 2013, p. 221.
- D. E. Knuth, Comments on A000179, Nov 25 2018 - Nov 27 2018.
- D. E. Knuth, Donald Knuth's 24th Annual Christmas Lecture: Dancing Links, Stanfordonline, Video published on YouTube, Dec 12, 2018.
- A. R. Kräuter, Über die Permanente gewisser zirkulärer Matrizen..., Séminaire Lotharingien de Combinatoire, B11b (1984), 11 pp.
- Yiting Li, Ménage Numbers and Ménage Permutations, J. Int. Seq. 18 (2015) 15.6.8
- E. Lucas, Théorie des Nombres, Gauthier-Villars, Paris, 1891, Vol. 1, p. 495.
- T. Muir, On Professor Tait's problem of arrangement, Proceedings of the Royal Society of Edinburgh 9 (1878) 382-387.
- T. Muir, On Professor Tait's problem of arrangement, Proceedings of the Royal Society of Edinburgh 9 (1878) 382-387.
- Vladimir Shevelev and Peter J. C. Moses, The ménage problem with a known mathematician, arXiv:1101.5321 [math.CO], 2011, 2015.
- Vladimir Shevelev and Peter J. C. Moses, Alice and Bob go to dinner: A variation on menage, INTEGERS, Vol. 16 (2016), #A72.
- R. J. Stones, S. Lin, X. Liu and G. Wang, On Computing the Number of Latin Rectangles, Graphs and Combinatorics (2016) 32:1187-1202; DOI 10.1007/s00373-015-1643-1.
- H. M. Taylor, A problem on arrangements, Mess. Math., 32 (1902), 60ff. [Annotated scanned copy]
- J. Touchard, Théorie des substitutions. Sur un problème de permutations, C. R. Acad. Sci. Paris 198 (1934), 631-633.
- Eric Weisstein's World of Mathematics, Married Couples Problem.
- Eric Weisstein's World of Mathematics, Rooks Problem.
- Wikipedia, Menage problem.
- M. Wyman and L. Moser, On the problème des ménages, Canad. J. Math., 10 (1958), 468-480.
- D. Zeilberger, Automatic Enumeration of Generalized Menage Numbers, arXiv preprint arXiv:1401.1089 [math.CO], 2014.
Cf.
A000904,
A059375,
A102761,
A000186,
A094047,
A067998,
A033999,
A258664,
A258665,
A258666,
A258667,
A258673,
A259212,
A213234,
A000023.
-
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
-
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
-
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 *)
-
\\ 3 programs adapted to a(1) = -1 by Hugo Pfoertner, Aug 31 2020
-
{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 */
-
a(n)=if(n>1, round(2*n*exp(-2)*besselk(n, 2)), 1-2*n) \\ Charles R Greathouse IV, Nov 03 2014
-
{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 */
-
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
A094047
Number of seating arrangements of n couples around a round table (up to rotations) so that each person sits between two people of the opposite sex and no couple is seated together.
Original entry on oeis.org
0, 0, 2, 12, 312, 9600, 416880, 23879520, 1749363840, 159591720960, 17747520940800, 2363738855385600, 371511874881100800, 68045361697964851200, 14367543450324474009600, 3464541314885011705344000, 946263209467217020194816000, 290616691739323132839591936000
Offset: 1
- 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.
- Seiichi Manyama, Table of n, a(n) for n = 1..253
- M. A. Alekseyev, Weighted de Bruijn Graphs for the Menage Problem and Its Generalizations. Lecture Notes in Computer Science 9843 (2016), 151-162. doi:10.1007/978-3-319-44543-4_12, arXiv:1510.07926, [math.CO], 2015-2016.
- H. M. Taylor, A problem on arrangements, Mess. Math., 32 (1902), 60ff. [Annotated scanned copy]
- Eric Weisstein's World of Mathematics, Crown Graph
- Eric Weisstein's World of Mathematics, Hamiltonian Cycle
Cf.
A059375 (rotations are counted as different).
-
A094047 := proc(n)
if n < 3 then
0;
else
(-1)^n*2*(n-1)!+n!*add( (-1)^j*(n-j-1)!*binomial(2*n-j-1,j),j=0..n-1) ;
end if;
end proc: # R. J. Mathar, Nov 02 2015
-
Join[{0},Table[(-1)^n 2(n-1)!+n!Sum[(-1)^j (n-j-1)!Binomial[2n-j-1,j],{j,0,n-1}],{n,2,20}]] (* Harvey P. Dale, Mar 07 2012 *)
A000512
Number of equivalence classes of n X n matrices over {0,1} with rows and columns summing to 3, where equivalence is defined by row and column permutations.
Original entry on oeis.org
0, 0, 1, 1, 2, 7, 16, 51, 224, 1165, 7454, 56349, 481309, 4548786, 46829325, 519812910, 6177695783, 78190425826, 1049510787100, 14886252250208, 222442888670708, 3492326723315796, 57468395960854710, 989052970923320185, 17767732298980160822, 332572885090541084172, 6475438355244504235759, 130954580036269713385884
Offset: 1
n=4: every matrix with 3 1's in each row and column can be transformed by permutation of rows (or columns) into {1110,1101,1011,0111}, therefore a(4)=1. - _Michael Steyer_, Feb 20 2003
- A. Burgess, P. Danziger, E. Mendelsohn, B. Stevens, Orthogonally Resolvable Cycle Decompositions, 2013; http://www.math.ryerson.ca/~andrea.burgess/OCD-submit.pdf
- Goulden and Jackson, Combin. Enum., Wiley, 1983 p. 284.
A079815 may be an erroneous version of this, or it may have a slightly different (as yet unknown) definition. -
N. J. A. Sloane, Sep 04 2010.
A102761
Same as A000179, except that a(0) = 2.
Original entry on oeis.org
2, -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
- J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 197.
-
{ A102761(n) = subst( serlaplace( 2*polchebyshev(n, 1, (x-2)/2)), x, 1); } \\ Max Alekseyev, Mar 06 2018
Changed a(0)=2 (making the sequence more consistent with existing formulae) by
Max Alekseyev, Mar 06 2018
A000321
H_n(-1/2), where H_n(x) is Hermite polynomial of degree n.
Original entry on oeis.org
1, -1, -1, 5, 1, -41, 31, 461, -895, -6481, 22591, 107029, -604031, -1964665, 17669471, 37341149, -567425279, -627491489, 19919950975, 2669742629, -759627879679, 652838174519, 31251532771999, -59976412450835, -1377594095061119, 4256461892701199, 64623242860354751
Offset: 0
- J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, p. 209.
- 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).
-
m:=30; R:=PowerSeriesRing(Rationals(), m); b:=Coefficients(R!(Exp(-x-x^2))); [Factorial(n-1)*b[n]: n in [1..m]]; // G. C. Greubel, Jun 09 2018
-
Table[HermiteH[n, -1/2], {n, 0, 25}] (* Vladimir Joseph Stephan Orlovsky, Jun 15 2009 *)
Table[(-2)^n HypergeometricU[-n/2, 1/2, 1/4], {n, 0, 25}] (* Benedict W. J. Irwin, Oct 17 2017 *)
-
N=66; x='x+O('x^N);
egf=exp(-x-x^2); Vec(serlaplace(egf))
/* Joerg Arndt, Mar 07 2013 */
-
vector(50, n, n--; sum(k=0, n/2, (-1)^(n-k)*k!*binomial(n, k)*binomial(n-k, k))) \\ Altug Alkan, Oct 22 2015
-
a(n) = polhermite(n, -1/2); \\ Michel Marcus, Oct 12 2016
-
from sympy import hermite
def a(n): return hermite(n, -1/2) # Indranil Ghosh, May 26 2017
A174564
Let J_n be n X n matrix which contains 1's only, I=I_n be the n X n identity matrix and P=P_n be the incidence matrix of the cycle (2,3,...,n,1). Then a(n) is the number of (0,1) n X n matrices A<=J_n-I-P with exactly two 1's in every row and column.
Original entry on oeis.org
0, 1, 13, 522, 27828, 1867363
Offset: 3
- V. S. Shevelev, Development of the rook technique for calculating the cyclic indicators of (0,1)-matrices, Izvestia Vuzov of the North-Caucasus region, Nature sciences 4 (1996), 21-28 (in Russian).
- S. E. Grigorchuk, V. S. Shevelev, An algorithm of computing the cyclic indicator of couples discordant permutations with restricted position, Izvestia Vuzov of the North-Caucasus region, Nature sciences 3 (1997), 5-13 (in Russian).
A001626
Number of 3-line Latin rectangles.
Original entry on oeis.org
0, 0, 2, 36, 840, 29680, 1429920, 90318144, 7237943552, 717442928640, 86171602072320, 12331048749268480, 2072725870491859968, 404352831489304049664, 90605920564322676531200, 23110943021722435879157760, 6657484407493222296916131840
Offset: 1
- S. M. Jacob, The enumeration of the Latin rectangle of depth three..., Proc. London Math. Soc., 31 (1928), 329-336.
- S. M. Kerawala, The enumeration of the Latin rectangle of depth three by means of a difference equation, Bull. Calcutta Math. Soc., 33 (1941), 119-127.
- 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).
A174556
Number of 3 X n Latin rectangles whose second row contains two cycles.
Original entry on oeis.org
12, 240, 10480, 535080, 34634544
Offset: 4
A174580
Let J_n be an n X n matrix which contains 1's only, I = I_n be the n X n identity matrix, and P = P_n be the incidence matrix of the cycle (1,2,3,...,n). Then a(n) is the number of (0,1,2) n X n matrices A <= 2(J_n - I - P) with exactly one 1 and one 2 in every row and column.
Original entry on oeis.org
0, 2, 36, 1462, 83600, 5955474
Offset: 3
- V. S. Shevelev, Development of the rook technique for calculating the cyclic indicators of (0,1)-matrices, Izvestia Vuzov of the North-Caucasus region, Nature sciences 4 (1996), 21-28 (in Russian).
- S. E. Grigorchuk, V. S. Shevelev, An algorithm of computing the cyclic indicator of couples discordant permutations with restricted position, Izvestia Vuzov of the North-Caucasus region, Nature sciences 3 (1997), 5-13 (in Russian).
Showing 1-10 of 26 results.
Comments