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 A082491 #66 May 22 2025 10:21:35 %S A082491 1,0,2,12,216,5280,190800,9344160,598066560,48443028480,4844306476800, %T A082491 586161043776000,84407190782745600,14264815236056985600, %U A082491 2795903786354347468800,629078351928420506112000,161044058093696572354560000,46541732789077953723039744000 %N A082491 a(n) = n! * d(n), where n! = factorial numbers (A000142), d(n) = subfactorial numbers (A000166). %C A082491 a(n) is also the number of pairs of n-permutations p and q such that p(x)<>q(x) for each x in { 1, 2, ..., n }. %C A082491 Or number of n X n matrices with exactly one 1 and one 2 in each row and column, other entries 0 (cf. A001499). - _Vladimir Shevelev_, Mar 22 2010 %C A082491 a(n) is approximately equal to (n!)^2/e. - _J. M. Bergot_, Jun 09 2018 %H A082491 Vincenzo Librandi, <a href="/A082491/b082491.txt">Table of n, a(n) for n = 0..200</a> %H A082491 Ira Gessel, <a href="http://www.mat.univie.ac.at/~slc/opapers/s17gessel.html">Enumerative applications of symmetric functions</a>, Séminaire Lotharingien de Combinatoire, B17a (1987), 17 pp. %H A082491 Shawn L. Witte, <a href="https://www.math.ucdavis.edu/~tdenena/dissertations/201910_Witte_Dissertation.pdf">Link Nomenclature, Random Grid Diagrams, and Markov Chain Methods in Knot Theory</a>, Ph. D. Dissertation, University of California-Davis (2020). %F A082491 a(n) = n! * d(n) where d(n) = A000166(n). %F A082491 a(n) = Sum_{k=0..n} binomial(n, k)^2 * (-1)^k * (n - k)!^2 * k!. %F A082491 a(n+2) = (n+2)*(n+1) * ( a(n+1) + (n+1)*a(n) ). %F A082491 a(n) ~ 2*Pi*n^(2*n+1)*exp(-2*n-1). - _Ilya Gutkovskiy_, Dec 04 2016 %p A082491 with (combstruct):a:=proc(m) [ZL, {ZL=Set(Cycle(Z, card>=m))}, labeled]; end: ZLL:=a(2):seq(count(ZLL, size=n)*n!, n=0..15); # _Zerinvary Lajos_, Jun 11 2008 %t A082491 Table[Subfactorial[n]*n!, {n, 0, 15}] (* _Zerinvary Lajos_, Jul 10 2009 *) %o A082491 (Maxima) A000166[0]:1$ %o A082491 A000166[n]:=n*A000166[n-1]+(-1)^n$ %o A082491 makelist(n!*A000166[n], n, 0, 12); /* _Emanuele Munarini_, Mar 01 2011 */ %o A082491 (PARI) %o A082491 d(n)=if(n<1, n==0, n*d(n-1)+(-1)^n); %o A082491 a(n)=d(n)*n!; %o A082491 vector(33,n,a(n-1)) %o A082491 /* _Joerg Arndt_, May 28 2012 */ %o A082491 (PARI) {a(n) = if( n<2, n==0, n! * round(n! / exp(1)))}; /* _Michael Somos_, Jun 24 2018 */ %o A082491 (Python) %o A082491 A082491_list, m, x = [], 1, 1 %o A082491 for n in range(10*2): %o A082491 x, m = x*n**2 + m, -(n+1)*m %o A082491 A082491_list.append(x) # _Chai Wah Wu_, Nov 03 2014 %o A082491 (Scala) %o A082491 val A082491_pairs: LazyList[BigInt && BigInt] = %o A082491 (BigInt(0), BigInt(1)) #:: %o A082491 (BigInt(1), BigInt(0)) #:: %o A082491 lift2 { %o A082491 case ((n, z), (_, y)) => %o A082491 (n+2, (n+2)*(n+1)*((n+1)*z+y)) %o A082491 } (A082491_pairs, A082491_pairs.tail) %o A082491 val A082491: LazyList[BigInt] = %o A082491 lift1(_._2)(A082491_pairs) %o A082491 /** _Luc Duponcheel_, Jan 25 2020 */ %Y A082491 Cf. A000142, A000166. %K A082491 easy,nonn %O A082491 0,3 %A A082491 _Emanuele Munarini_, Apr 28 2003