OFFSET
2,4
REFERENCES
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).
LINKS
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
FORMULA
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
a(n) = (n-3)*floor(((n-2)!+1)/e) + (n-4)*floor(((n-3)!+1)/e), for n>2. - Gary Detlefs, Apr 10 2010
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
EXAMPLE
G.f.: x^4 + 5*x^5 + 31*x^6 + 203*x^7 + 1501*x^8 + 12449*x^9 + 114955*x^10 + ...
MAPLE
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
MATHEMATICA
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 *)
PROG
(PARI)
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 */
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
EXTENSIONS
More terms from Harvey P. Dale, Feb 05 2012
STATUS
approved