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.
%I A002467 M3507 N1423 #156 Jul 07 2025 00:24:14 %S A002467 0,1,1,4,15,76,455,3186,25487,229384,2293839,25232230,302786759, %T A002467 3936227868,55107190151,826607852266,13225725636255,224837335816336, %U A002467 4047072044694047,76894368849186894,1537887376983737879,32295634916658495460,710503968166486900119 %N 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?). %C A002467 a(n) is the number of permutations in the symmetric group S_n that have a fixed point, i.e., they are not derangements (A000166). - Ahmed Fares (ahmedfares(AT)my-deja.com), May 08 2001 %C A002467 a(n+1)=p(n+1) where p(x) is the unique degree-n polynomial such that p(k)=k! for k=0,1,...,n. - _Michael Somos_, Oct 07 2003 %C A002467 The termwise sum of this sequence and A000166 gives the factorial numbers. - D. G. Rogers, Aug 26 2006, Jan 06 2008 %C A002467 a(n) is the number of deco polyominoes of height n and having in the last column an odd number of cells. A deco polyomino is a directed column-convex polyomino in which the height, measured along the diagonal, is attained only in the last column. Example: a(2)=1 because the horizontal domino is the only deco polyomino of height 2 having an odd number of cells in the last column. - _Emeric Deutsch_, May 08 2008 %C A002467 Starting (1, 4, 15, 76, 455, ...) = eigensequence of triangle A127899 (unsigned). - _Gary W. Adamson_, Dec 29 2008 %C A002467 (n-1) | a(n), hence a(n) is never prime. - _Jonathan Vos Post_, Mar 25 2009 %C A002467 a(n) is the number of permutations of [n] that have at least one fixed point = number of positive terms in n-th row of the triangle in A170942, n > 0. - _Reinhard Zumkeller_, Mar 29 2012 %C A002467 Numerator of partial sum of alternating harmonic series, provided that the denominator is n!. - _Richard Locke Peterson_, May 11 2020 %C A002467 a(n) is the number of terms in the polynomial expansion of the determinant of a n X n matrix that contains at least one diagonal element. - _Adam Wang_, May 28 2025 %D A002467 R. K. Guy, Unsolved Problems Number Theory, E37. %D A002467 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 A002467 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence). %D A002467 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A002467 Alois P. Heinz, <a href="/A002467/b002467.txt">Table of n, a(n) for n = 0..450</a> (first 101 terms from T. D. Noe) %H A002467 E. Barcucci, A. Del Lungo and R. Pinzani, <a href="http://dx.doi.org/10.1016/0304-3975(95)00199-9">"Deco" polyominoes, permutations and random generation</a>, Theoretical Computer Science, 159, 1996, 29-42. %H A002467 P. R. de Montmort, <a href="http://dx.doi.org/10.1007/978-1-4757-3500-0_4">On the Game of Thirteen (1713)</a>, reprinted in Annotated Readings in the History of Statistics, ed. H. A. David and A. W. F. Edwards, Springer-Verlag, 2001, pp. 25-29. %H A002467 Sergi Elizalde, <a href="https://arxiv.org/abs/2006.13842">Bijections for restricted inversion sequences and permutations with fixed points</a>, arXiv:2006.13842 [math.CO], 2020. %H A002467 R. K. Guy, <a href="/A002467/a002467.pdf">Letter to N. J. A. Sloane, Feb 10 1993</a> %H A002467 R. K. Guy and R. J. Nowakowski, <a href="/A002467/a002467_1.pdf">Mousetrap</a>, Preprint, Feb 10 1993 [Annotated scanned copy] %H A002467 R. K. Guy and S. Washburn, <a href="/A002467/a002467_2.pdf">Correspondence, Nov. - Dec. 1991</a> %H A002467 T. Kotek, J. A. Makowsky, <a href="http://arxiv.org/abs/1309.4020">Recurrence Relations for Graph Polynomials on Bi-iterative Families of Graphs</a>, arXiv preprint arXiv:1309.4020 [math.CO], 2013. %H A002467 J. Metzger, <a href="/A002467/a002467_3.pdf">Email to N. J. A. Sloane, Apr 30 1991</a> %H A002467 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 A002467 Alexsandar Petojevic, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL5/Petojevic/petojevic5.html">The Function vM_m(s; a; z) and Some Well-Known Sequences</a>, Journal of Integer Sequences, Vol. 5 (2002), Article 02.1.7. %H A002467 Simon Plouffe, <a href="http://www.plouffe.fr/simon/exact.htm">Exact formulas for Integer Sequences.</a> %H A002467 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 A002467 L. Takacs, <a href="http://dx.doi.org/10.1007/BF00327875">The Problem of Coincidences</a>, Archive for History of Exact Sciences, Volume 21, No. 3, Sept. 1980. pp 229-244, paragraphs 5 and 7. %H A002467 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Mousetrap.html">Mousetrap</a> %F A002467 a(n) = n! - A000166(n) = A000142(n) - A000166(n). %F A002467 E.g.f.: (1 - exp(-x)) / (1 - x). - _Michael Somos_, Aug 11 1999 %F A002467 a(n) = (n-1)*(a(n-1) + a(n-2)), n > 1; a(1) = 1. - _Michael Somos_, Aug 11 1999 %F A002467 a(n) = n*a(n-1) - (-1)^n. - _Michael Somos_, Aug 11 1999 %F A002467 a(0) = 0, a(n) = floor(n!(e-1)/e + 1/2) for n > 0. - _Michael Somos_, Aug 11 1999 %F A002467 a(n) = - n! * Sum_{i=1..n} (-1)^i/i!. Limit_{n->infinity} a(n)/n! = 1 - 1/e. - _Gerald McGarvey_, Jun 08 2004 %F A002467 Inverse binomial transform of A002627. - _Ross La Haye_, Sep 21 2004 %F A002467 a(n) = (n-1)*(a(n-1) + a(n-2)), n > 1. - _Gary Detlefs_, Apr 11 2010 %F A002467 a(n) = n! - floor((n!+1)/e), n > 0. - _Gary Detlefs_, Apr 11 2010 %F A002467 For n > 0, a(n) = {(1-1/exp(1))*n!}, where {x} is the nearest integer. - _Simon Plouffe_, conjectured March 1993, added Feb 17 2011 %F A002467 0 = a(n) * (a(n+1) + a(n+2) - a(n+3)) + a(n+1) * (a(n+1) + 2*a(n+2) - a(n+3)) + a(n+2) * (a(n+2)) if n >= 0. - _Michael Somos_, Jan 25 2014 %F A002467 a(n) = Gamma(n+1) - Gamma(n+1, -1)*exp(-1). - _Peter Luschny_, Feb 28 2017 %F A002467 a(n) = Sum_{k=0..n-1} A047920(n-1,k). - _Alois P. Heinz_, Sep 01 2021 %e A002467 G.f. = x + x^2 + 4*x^3 + 15*x^4 + 76*x^5 + 455*x^6 + 3186*x^7 + 25487*x^8 + ... %p A002467 a := proc(n) -add((-1)^i*binomial(n, i)*(n-i)!, i=1..n) end; %p A002467 a := n->-n!*add((-1)^k/k!, k=1..n): seq(a(n), n=0..20); # _Zerinvary Lajos_, May 25 2007 %p A002467 a := n -> simplify(GAMMA(n+1) - GAMMA(n+1, -1)*exp(-1)): %p A002467 seq(a(n), n=0..20); # _Peter Luschny_, Feb 28 2017 %t A002467 Denominator[k=1; NestList[1+1/(k++ #1)&,1,12]] (* _Wouter Meeussen_, Mar 24 2007 *) %t A002467 a[ n_] := If[ n < 0, 0, n! - Subfactorial[n]] (* _Michael Somos_, Jan 25 2014 *) %t A002467 a[ n_] := If[ n < 1, 0, n! - Round[ n! / E]] (* _Michael Somos_, Jan 25 2014 *) %t A002467 a[ n_] := If[ n < 0, 0, n! - (-1)^n HypergeometricPFQ[ {- n, 1}, {}, 1]](* _Michael Somos_, Jan 25 2014 *) %t A002467 a[ n_] := If[ n < 0, 0, n! SeriesCoefficient[ (1 - Exp[ -x] ) / (1 - x), {x, 0, n}]] (* _Michael Somos_, Jan 25 2014 *) %t A002467 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 *) %o A002467 (PARI) {a(n) = if( n<1, 0, n * a(n-1) - (-1)^n)} /* _Michael Somos_, Mar 24 2003 */ %o A002467 (PARI) {a(n) = if( n<0, 0, n! * polcoeff( (1 - exp( -x + x * O(x^n))) / (1 - x), n))} /* _Michael Somos_, Mar 24 2003 */ %o A002467 (PARI) a(n) = if(n<1,0,subst(polinterpolate(vector(n,k,(k-1)!)),x,n+1)) %o A002467 (PARI) A002467(n) = if(n<1, 0, n*A002467(n-1)-(-1)^n); \\ _Joerg Arndt_, Apr 22 2013 %Y A002467 Cf. A002468, A002469, A028306, A047920, A052169, A127899, A276975. %Y A002467 Row sums of A068106. %Y A002467 Column k=1 of A293211. %Y A002467 Column k=0 of A299789, A306234, and of A324362. %K A002467 nonn,easy,nice %O A002467 0,4 %A A002467 _N. J. A. Sloane_, _Jeffrey Shallit_