Original entry on oeis.org
0, 1, 3, 13, 65, 403, 2885, 23515, 214805
Offset: 2
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
A002469
The game of Mousetrap with n cards: the number of permutations of n cards in which 2 is the only hit.
Original entry on oeis.org
0, 0, 1, 5, 31, 203, 1501, 12449, 114955, 1171799, 13082617, 158860349, 2085208951, 29427878435, 444413828821, 7151855533913, 122190894996451, 2209057440250799, 42133729714051825, 845553296311189109, 17810791160738752207, 392911423093684031099
Offset: 2
G.f.: x^4 + 5*x^5 + 31*x^6 + 203*x^7 + 1501*x^8 + 12449*x^9 + 114955*x^10 + ...
- 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).
- Vincenzo Librandi, Table of n, a(n) for n = 2..100
- R. K. Guy and R. J. Nowakowski, Mousetrap, Preprint, Feb 10 1993 [Annotated scanned copy]
- 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.
- M. Z. Spivey, Staircase rook polynomials and Cayley's game of mousetrap, Eur. J. Combinat. 30 (2) (2009) 532-539
- A. Steen, Some formulas respecting the game of mousetrap, Quart. J. Pure Applied Math., 15 (1878), 230-241.
- Eric Weisstein's World of Mathematics, Mousetrap
-
A002469:=n->(n-3)*floor(((n-2)!+1)/exp(1)) + (n-4)*floor(((n-3)!+1)/exp(1)): 0, seq(A002469(n), n=3..30); # Wesley Ivan Hurt, Jan 10 2017
-
Join[{0},Table[(n-3)Floor[((n-2)!+1)/E]+(n-4)Floor[((n-3)!+1)/E], {n,3,30}]] (* Harvey P. Dale, Feb 05 2012 *)
a[n_] := (n-3)*Subfactorial[n-2]+(n-4)*Subfactorial[n-3]; a[n_ /; n <= 3] = 0; Table[a[n], {n, 2, 23}] (* Jean-François Alcover, Dec 12 2014 *)
-
default(realprecision,200);
e=exp(1);
A002469(n) = if( n<=3, 0, (n-3)*floor(((n-2)!+1)/e) + (n-4)*floor(((n-3)!+1)/e) );
/* Joerg Arndt, Apr 22 2013 */
A018934
From the game of Mousetrap.
Original entry on oeis.org
0, 0, 0, 2, 8, 42, 256, 1810, 14568, 131642, 1320128, 14551074, 174879880, 2276108362, 31894886208, 478775722802, 7664993150696, 130369025763930, 2347604596782208, 44619881467365442, 892659329531868168, 18750556523491299434, 412601744979927877760, 9491630163800726992722
Offset: 0
-
Join[{0,0},With[{nn=30},CoefficientList[Series[(2x Exp[-x])/(1-x)^3, {x,0,nn}],x] Range[0,nn]!]] (* Harvey P. Dale, Nov 16 2013 *)
-
C=binomial;
a(n)=if(n<=2, 0, n! + sum(k=1,n, (-1)^k * ( C(n-1,k)+C(n-2,k-1) )*(n-k)! ) );
/* Joerg Arndt, Apr 22 2013 */
-
def A():
a, b, n = 1, 1, 1
yield 0
while True:
yield b - a
n += 1
a, b = b, (n-2)*a+(n-1)*b
A018934 = A()
print([next(A018934) for in range(24)]) # _Peter Luschny, Jan 30 2017
A018932
The number of permutations of n cards in which 4 will be the next hit after 2.
Original entry on oeis.org
0, 3, 10, 60, 408, 3120, 26640, 252000, 2620800, 29756160, 366508800, 4869849600, 69455232000, 1058593536000, 17174123366400, 295534407168000, 5377157001216000, 103149354147840000, 2080771454361600000
Offset: 4
-
Concatenation([0,3], List([6..30], n-> (n^2-8*n+17)*Factorial(n-4) )); # G. C. Greubel, Feb 21 2019
-
[0,3] cat [(n^2-8*n+17)*Factorial(n-4): n in [6..30]]; // G. C. Greubel, Feb 21 2019
-
0,3,seq((n^2-8*n+17)*factorial(n-4),n=6..30); # Muniru A Asiru, Feb 22 2019
-
Join[{0,3}, Table[(n^2-8*n+17)*(n-4)!, {n,6,30}]] (* G. C. Greubel, Feb 21 2019 *)
-
for(n=4,30, print1(if(n==4, 0, if(n==5, 3, (n^2-8*n+17)*(n-4)!)), ", ")) \\ G. C. Greubel, Feb 21 2019
-
[0,3] + [(n^2-8*n+17)*factorial(n-4) for n in (6..30)] # G. C. Greubel, Feb 21 2019
Offset changed to 4, more terms, better definition and link from
R. J. Mathar, Oct 02 2008
A018931
The number of permutations of n cards in which 2 is the first card hit and 3 the next hit after 2.
Original entry on oeis.org
0, 1, 2, 12, 72, 480, 3600, 30240, 282240, 2903040, 32659200, 399168000, 5269017600, 74724249600, 1133317785600, 18307441152000, 313841848320000, 5690998849536000, 108840352997376000, 2189611807358976000, 46225138155356160000, 1021818843434188800000
Offset: 3
- Daniel J. Mundfrom, A problem in permutations: the game of "Mousetrap". European J. Combin. 15 (1994), no. 6, 555-560.
Offset changed to 3 and more precise definition provided by
R. J. Mathar, Oct 02 2008
A018933
From the game of Mousetrap.
Original entry on oeis.org
2, 11, 50, 348, 2712, 23520, 225360, 2368800, 27135360, 336752640, 4503340800, 64585382400, 989138304000, 16115529830400, 278360283801600, 5081622594048000, 97772197146624000, 1977622100213760000
Offset: 0
-
c := proc(n,x) local a,i; if n > x+1 then a := (n-2)! ; for i from 3 to x do a := a+(-1)^i*(binomial(x-2,i-2)+binomial(x-3,i-3))*(n-i)! ; od: fi; a ; end: A018933 := proc(n) if n = 5 then 2 ; elif n = 6 then 11 ; else c(n,5) ; fi: end: for n from 5 to 23 do printf("%d,",A018933(n)) ; od: # R. J. Mathar, Oct 02 2008
-
c[n_, x_] := Module[{a = 0, i}, If[n > x+1, a = (n-2)!; For[i = 3, i <= x, i++, a += (-1)^i (Binomial[x-2, i-2] + Binomial[x-3, i-3]) (n-i)!]]; a];
b[n_] := If[n == 5, 2, If[n == 6, 11, c[n, 5]]];
a[n_] := b[n + 5];
a /@ Range[0, 17] (* Jean-François Alcover, Apr 05 2020, after R. J. Mathar *)
This entry was corrupted by a misplaced edit Nov 30 2007; previous (and correct) version restored by
N. J. A. Sloane Jan 25 2008
Showing 1-7 of 7 results.
Comments