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.

A002469 The game of Mousetrap with n cards: the number of permutations of n cards in which 2 is the only hit.

This page as a plain text file.
%I A002469 M3962 N1635 #60 Feb 16 2025 08:32:25
%S A002469 0,0,1,5,31,203,1501,12449,114955,1171799,13082617,158860349,
%T A002469 2085208951,29427878435,444413828821,7151855533913,122190894996451,
%U A002469 2209057440250799,42133729714051825,845553296311189109,17810791160738752207,392911423093684031099
%N A002469 The game of Mousetrap with n cards: the number of permutations of n cards in which 2 is the only hit.
%D A002469 R. K. Guy, Unsolved Problems Number Theory, E37.
%D A002469 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.
%D A002469 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
%D A002469 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A002469 Vincenzo Librandi, <a href="/A002469/b002469.txt">Table of n, a(n) for n = 2..100</a>
%H A002469 R. K. Guy and R. J. Nowakowski, <a href="/A002467/a002467_1.pdf">Mousetrap</a>, Preprint, Feb 10 1993 [Annotated scanned copy]
%H A002469 J. Metzger, <a href="/A002467/a002467_3.pdf">Email to N. J. A. Sloane, Apr 30 1991</a>
%H A002469 Daniel J. Mundfrom, <a href="http://dx.doi.org/10.1006/eujc.1994.1057">A problem in permutations: the game of 'Mousetrap'</a>. European J. Combin. 15 (1994), no. 6, 555-560.
%H A002469 M. Z. Spivey, <a href="http://dx.doi.org/10.1016/j.ejc.2008.04.005">Staircase rook polynomials and Cayley's game of mousetrap</a>, Eur. J. Combinat. 30 (2) (2009) 532-539
%H A002469 A. Steen, <a href="http://resolver.sub.uni-goettingen.de/purl?PPN600494829_0015/DMDLOG_0031">Some formulas respecting the game of mousetrap</a>, Quart. J. Pure Applied Math., 15 (1878), 230-241.
%H A002469 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Mousetrap.html">Mousetrap</a>
%F A002469 a(n) = sum of terms in (n-2)-nd row of triangle A159610; equivalent to: a(n) = (n-2)*A000255(n-1) + A000166(n). -  _Gary W. Adamson_, Apr 17 2009
%F A002469 a(n) = (n-3)* A000166(n-2) + (n-4)* A000166(n-3). - _Gary Detlefs_, Apr 10 2010
%F A002469 a(n) = (n-3)*floor(((n-2)!+1)/e) + (n-4)*floor(((n-3)!+1)/e), for n>2. - _Gary Detlefs_, Apr 10 2010
%F A002469 G.f.: x - 1 + (1-2*x)/(x*Q(0)), where Q(k) = 1/x - (2*k+1) - (k+1)*(k+2)/Q(k+1); (continued fraction). - _Sergei N. Gladkovskii_, Apr 25 2013
%e A002469 G.f.: x^4 + 5*x^5 + 31*x^6 + 203*x^7 + 1501*x^8 + 12449*x^9 + 114955*x^10 + ...
%p A002469 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
%t A002469 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 *)
%t A002469 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 *)
%o A002469 (PARI)
%o A002469 default(realprecision,200);
%o A002469 e=exp(1);
%o A002469 A002469(n) = if( n<=3, 0, (n-3)*floor(((n-2)!+1)/e) + (n-4)*floor(((n-3)!+1)/e) );
%o A002469 /* _Joerg Arndt_, Apr 22 2013 */
%Y A002469 Cf. A002468, A002467, A028306, A159610, A000255, A000166.
%K A002469 nonn,nice
%O A002469 2,4
%A A002469 _N. J. A. Sloane_
%E A002469 More terms from _Harvey P. Dale_, Feb 05 2012