A002467
The game of Mousetrap with n cards (given n letters and n envelopes, how many ways are there to fill the envelopes so that at least one letter goes into its right envelope?).
Original entry on oeis.org
0, 1, 1, 4, 15, 76, 455, 3186, 25487, 229384, 2293839, 25232230, 302786759, 3936227868, 55107190151, 826607852266, 13225725636255, 224837335816336, 4047072044694047, 76894368849186894, 1537887376983737879, 32295634916658495460, 710503968166486900119
Offset: 0
G.f. = x + x^2 + 4*x^3 + 15*x^4 + 76*x^5 + 455*x^6 + 3186*x^7 + 25487*x^8 + ...
- R. K. Guy, Unsolved Problems Number Theory, E37.
- R. K. Guy and R. J. Nowakowski, "Mousetrap," in D. Miklos, V. T. Sos and T. Szonyi, eds., Combinatorics, Paul Erdős is Eighty. Bolyai Society Math. Studies, Vol. 1, pp. 193-206, 1993.
- 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).
- Alois P. Heinz, Table of n, a(n) for n = 0..450 (first 101 terms from T. D. Noe)
- E. Barcucci, A. Del Lungo and R. Pinzani, "Deco" polyominoes, permutations and random generation, Theoretical Computer Science, 159, 1996, 29-42.
- P. R. de Montmort, On the Game of Thirteen (1713), reprinted in Annotated Readings in the History of Statistics, ed. H. A. David and A. W. F. Edwards, Springer-Verlag, 2001, pp. 25-29.
- Sergi Elizalde, Bijections for restricted inversion sequences and permutations with fixed points, arXiv:2006.13842 [math.CO], 2020.
- R. K. Guy, Letter to N. J. A. Sloane, Feb 10 1993
- R. K. Guy and R. J. Nowakowski, Mousetrap, Preprint, Feb 10 1993 [Annotated scanned copy]
- R. K. Guy and S. Washburn, Correspondence, Nov. - Dec. 1991
- T. Kotek, J. A. Makowsky, Recurrence Relations for Graph Polynomials on Bi-iterative Families of Graphs, arXiv preprint arXiv:1309.4020 [math.CO], 2013.
- J. Metzger, Email to N. J. A. Sloane, Apr 30 1991
- Daniel J. Mundfrom, A problem in permutations: the game of 'Mousetrap', European J. Combin. 15 (1994), no. 6, 555-560.
- Alexsandar Petojevic, The Function vM_m(s; a; z) and Some Well-Known Sequences, Journal of Integer Sequences, Vol. 5 (2002), Article 02.1.7.
- Simon Plouffe, Exact formulas for Integer Sequences.
- A. Steen, Some formulas respecting the game of mousetrap, Quart. J. Pure Applied Math., 15 (1878), 230-241.
- L. Takacs, The Problem of Coincidences, Archive for History of Exact Sciences, Volume 21, No. 3, Sept. 1980. pp 229-244, paragraphs 5 and 7.
- Eric Weisstein's World of Mathematics, Mousetrap
-
a := proc(n) -add((-1)^i*binomial(n, i)*(n-i)!, i=1..n) end;
a := n->-n!*add((-1)^k/k!, k=1..n): seq(a(n), n=0..20); # Zerinvary Lajos, May 25 2007
a := n -> simplify(GAMMA(n+1) - GAMMA(n+1, -1)*exp(-1)):
seq(a(n), n=0..20); # Peter Luschny, Feb 28 2017
-
Denominator[k=1; NestList[1+1/(k++ #1)&,1,12]] (* Wouter Meeussen, Mar 24 2007 *)
a[ n_] := If[ n < 0, 0, n! - Subfactorial[n]] (* Michael Somos, Jan 25 2014 *)
a[ n_] := If[ n < 1, 0, n! - Round[ n! / E]] (* Michael Somos, Jan 25 2014 *)
a[ n_] := If[ n < 0, 0, n! - (-1)^n HypergeometricPFQ[ {- n, 1}, {}, 1]](* Michael Somos, Jan 25 2014 *)
a[ n_] := If[ n < 0, 0, n! SeriesCoefficient[ (1 - Exp[ -x] ) / (1 - x), {x, 0, n}]] (* Michael Somos, Jan 25 2014 *)
RecurrenceTable[{a[n] == (n - 1) ( a[n - 1] + a[n - 2]), a[0] == 0, a[1] == 1}, a[n], {n, 20}] (* Ray Chandler, Jul 30 2015 *)
-
{a(n) = if( n<1, 0, n * a(n-1) - (-1)^n)} /* Michael Somos, Mar 24 2003 */
-
{a(n) = if( n<0, 0, n! * polcoeff( (1 - exp( -x + x * O(x^n))) / (1 - x), n))} /* Michael Somos, Mar 24 2003 */
-
a(n) = if(n<1,0,subst(polinterpolate(vector(n,k,(k-1)!)),x,n+1))
-
A002467(n) = if(n<1, 0, n*A002467(n-1)-(-1)^n); \\ Joerg Arndt, Apr 22 2013
A132961
Total number of all distinct cycle sizes in all permutations of [n].
Original entry on oeis.org
1, 2, 9, 38, 215, 1384, 10409, 86946, 825075, 8541998, 97590779, 1205343952, 16148472977, 231416203212, 3560209750005, 58104163643054, 1008693571819919, 18477578835352366, 357476371577422955, 7258865626801695048, 154893910336866444009, 3454112338490001478772
Offset: 1
-
with(combinat):
b:= proc(n, i) option remember; `if`(n=0, [1, 0], `if`(i<1, 0,
add(multinomial(n, n-i*j, i$j)/j!*(i-1)!^j*(p-> p+
[0, p[1]*`if`(j>0, 1, 0)])(b(n-i*j, i-1)), j=0..n/i)))
end:
a:= n-> b(n$2)[2]:
seq(a(n), n=1..30); # Alois P. Heinz, Oct 21 2015
-
Rest[ Range[0, 22]! CoefficientList[ Series[1/(1 - x) Sum[1 - Exp[ -x^k/k], {k, 25}], {x, 0, 22}], x]] (* Robert G. Wilson v, Sep 13 2007 *)
A027616
Number of permutations of n elements containing a 2-cycle.
Original entry on oeis.org
0, 0, 1, 3, 9, 45, 285, 1995, 15855, 142695, 1427895, 15706845, 188471745, 2450132685, 34301992725, 514529890875, 8232476226975, 139952095858575, 2519137759913775, 47863617438361725, 957272348112505425, 20102719310362613925, 442259824841726816925, 10171975971359716789275
Offset: 0
Joe Keane (jgk(AT)jgk.org)
-
A027616:= func< n | Factorial(n)*(1- (&+[(-1/2)^j/Factorial(j): j in [0..Floor(n/2)]]) ) >;
[A027616(n): n in [0..30]]; // G. C. Greubel, Aug 05 2022
-
S:= series((1-exp(-x^2/2))/(1-x), x, 101):
seq(coeff(S,x,j)*j!,j=0..100); # Robert Israel, May 12 2016
-
nn=30; Table[n!,{n,0,nn}]-Range[0,nn]!CoefficientList[Series[Exp[-x^2/2]/(1-x),{x,0,nn}],x] (* Geoffrey Critzer, Oct 20 2012 *)
-
a(n) = n! * (1 - sum(k=0,floor(n/2), (-1)^k / (2^k * k!) ) );
/* Joerg Arndt, Oct 20 2012 */
-
N=33; x='x+O('x^N);
v=Vec( 'a0 + serlaplace( (1-exp(-x^2/2))/(1-x) ) );
v[1]-='a0; v
/* Joerg Arndt, Oct 20 2012 */
-
def A027616(n): return factorial(n)*(1-sum((-1/2)^k/factorial(k) for k in (0..(n//2))))
[A027616(n) for n in (0..30)] # G. C. Greubel, Aug 05 2022
A052145
a(n) = (2n-1)*(2n-1)!/n.
Original entry on oeis.org
1, 9, 200, 8820, 653184, 73180800, 11564467200, 2451889440000, 671854030848000, 231125690776780800, 97537253236899840000, 49549698749529538560000, 29829250083328819200000000, 20999962511521107738624000000, 17094073187896757112117657600000
Offset: 1
For n=2, there are 9 permutations of [4] = { 1, 2, 3, 4 } which have a cycle of length 2: each of the 4*3/2 = 6 transpositions, plus the 3 different possible products of two transpositions. - _M. F. Hasler_, Apr 21 2015
- R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Problem 7.68(d).
A122974
Triangle T(n,k), the number of permutations on n elements that have no cycles of length k.
Original entry on oeis.org
0, 1, 1, 2, 3, 4, 9, 15, 16, 18, 44, 75, 80, 90, 96, 265, 435, 520, 540, 576, 600, 1854, 3045, 3640, 3780, 4032, 4200, 4320, 14833, 24465, 29120, 31500, 32256, 33600, 34560, 35280, 133496, 220185, 259840, 283500, 290304, 302400, 311040, 317520, 322560
Offset: 1
T(3,2)=3 since there are exactly 3 permutations of 1,2,3 that have no cycles of length 2, namely, (1)(2)(3),(1 2 3) and (2 1 3).
Triangle T(n,k) begins:
0;
1, 1;
2, 3, 4;
9, 15, 16, 18;
44, 75, 80, 90, 96;
265, 435, 520, 540, 576, 600;
1854, 3045, 3640, 3780, 4032, 4200, 4320;
14833, 24465, 29120, 31500, 32256, 33600, 34560, 35280;
...
-
seq((round((2*n)^.5))!*sum((-1/(n-binomial(round((2*n)^.5),2)))^r/r!,r=0..floor(round((2*n)^.5)/(n-binomial(round((2*n)^.5),2)))),n=1..66);
# second Maple program:
T:= proc(n, k) option remember; `if`(n=0, 1, add(`if`(j=k, 0,
T(n-j, k)*binomial(n-1, j-1)*(j-1)!), j=1..n))
end:
seq(seq(T(n, k), k=1..n), n=1..12); # Alois P. Heinz, Nov 24 2019
-
T[n_, k_] := T[n, k] = If[n==0, 1, Sum[If[j==k, 0, T[n - j, k] Binomial[n - 1, j - 1] (j - 1)!], {j, 1, n}]];
Table[Table[T[n, k], {k, 1, n}], {n, 1, 12}] // Flatten (* Jean-François Alcover, Dec 08 2019, after Alois P. Heinz *)
A027617
Number of permutations of n elements containing a 3-cycle.
Original entry on oeis.org
0, 0, 0, 2, 8, 40, 200, 1400, 11200, 103040, 1030400, 11334400, 135766400, 1764963200, 24709484800, 370687116800, 5930993868800, 100826895769600, 1814871926067200, 34482566595276800, 689651331905536000, 14482682605174784000, 318619017313845248000
Offset: 0
Joe Keane (jgk(AT)jgk.org)
-
nn=20;Range[0,nn]!CoefficientList[Series[1/(1-x)-Exp[-x^3/3]/(1-x), {x,0,nn}],x] (* Geoffrey Critzer, Jan 23 2013 *)
-
a(n) = n! * (1 - sum(k=0, floor(n/3), (-1)^k/(k!*3^k) ) ); \\ Stéphane Rézel, Dec 11 2019
A029571
Number of permutations of an n-set containing a 4-cycle.
Original entry on oeis.org
0, 0, 0, 0, 6, 30, 180, 1260, 8820, 79380, 793800, 8731800, 106029000, 1378377000, 19297278000, 289459170000, 4627941318000, 78675002406000, 1416150043308000, 26906850822852000, 538156815464268000
Offset: 0
-
L:= [seq( 1 - add((-1)^k/(k!*4^k),k=0..m),m=0..10)]:
seq(seq((4*m+j)!*L[m+1],j=0..3),m=0..10); # Robert Israel, Dec 07 2016
-
a[n_] := n! (1 - Sum[(-1)^k/(k! 4^k), {k, 0, Floor[n/4]}]);
Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Mar 19 2019 *)
-
a(n)=n! * (1 - sum(k=0,floor(n/4), (-1)^k/(k!*4^k) ) ); \\ Joerg Arndt, Aug 08 2013
A029572
Number of permutations of an n-set containing a 5-cycle.
Original entry on oeis.org
0, 0, 0, 0, 0, 24, 144, 1008, 8064, 72576, 653184, 7185024, 86220288, 1120863744, 15692092416, 237124952064, 3793999233024, 64497986961408, 1160963765305344, 22058311540801536, 441004037348818944, 9261084784325197824, 203743865255154352128, 4686108900868550098944
Offset: 0
-
nn = 20; a = Log[1/(1 - x)] - x^5/5; Range[0, nn]! CoefficientList[Series[1/(1 - x) - Exp[a], {x, 0, nn}],x] (* Geoffrey Critzer, Jun 01 2013 *)
-
my(x='x+O('x^66)); concat([0,0,0,0,0], Vec(serlaplace((1-exp(-x^5/5))/(1-x)))) \\ Joerg Arndt, Jun 01 2013
A029573
Number of permutations of an n-set containing a 6-cycle.
Original entry on oeis.org
0, 0, 0, 0, 0, 0, 120, 840, 6720, 60480, 604800, 6652800, 73180800, 951350400, 13318905600, 199783584000, 3196537344000, 54341134848000, 983080530432000, 18678530078208000, 373570601564160000, 7844982632847360000, 172589617922641920000, 3969561212220764160000
Offset: 0
A029574
Number of permutations of an n-set containing a 7-cycle.
Original entry on oeis.org
0, 0, 0, 0, 0, 0, 0, 720, 5760, 51840, 518400, 5702400, 68428800, 889574400, 11564467200, 173467008000, 2775472128000, 47183026176000, 849294471168000, 16136594952192000, 322731899043840000, 6802195410616320000, 149648299033559040000, 3441910877771857920000
Offset: 0
Showing 1-10 of 13 results.
Comments