|
|
A082491
|
|
a(n) = n! * d(n), where n! = factorial numbers (A000142), d(n) = subfactorial numbers (A000166).
|
|
10
|
|
|
1, 0, 2, 12, 216, 5280, 190800, 9344160, 598066560, 48443028480, 4844306476800, 586161043776000, 84407190782745600, 14264815236056985600, 2795903786354347468800, 629078351928420506112000, 161044058093696572354560000, 46541732789077953723039744000
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
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 }.
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
a(n) is approximately equal to (n!)^2/e. - J. M. Bergot, Jun 09 2018
|
|
LINKS
|
|
|
FORMULA
|
a(n) = n! * d(n) where d(n) = A000166(n).
a(n) = Sum_{k=0..n} binomial(n, k)^2 * (-1)^k * (n - k)!^2 * k!.
a(n+2) = (n+2)*(n+1) * ( a(n+1) + (n+1)*a(n) ).
|
|
MAPLE
|
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
|
|
MATHEMATICA
|
|
|
PROG
|
(PARI)
d(n)=if(n<1, n==0, n*d(n-1)+(-1)^n);
a(n)=d(n)*n!;
vector(33, n, a(n-1))
(PARI) {a(n) = if( n<2, n==0, n! * round(n! / exp(1)))}; /* Michael Somos, Jun 24 2018 */
(Python)
for n in range(10*2):
....x, m = x*n**2 + m, -(n+1)*m
(Scala)
val A082491_pairs: LazyList[BigInt && BigInt] =
(BigInt(0), BigInt(1)) #::
(BigInt(1), BigInt(0)) #::
lift2 {
case ((n, z), (_, y)) =>
(n+2, (n+2)*(n+1)*((n+1)*z+y))
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|