OFFSET
1,2
COMMENTS
(2n)!*(H(2n)-H(n)) where H(n) is the harmonic number. See "One Hundred Prisoners" in Wikipedia reference below.
REFERENCES
Richcard Stanley, Enumerative Combinatorics Volume 1 second edition, Cambridge Univ. Press, 2011, page 194 solution 119.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..100
Wikipedia, Random permutation statistics
FORMULA
The E.g.f. for the number of n-permutations that have a cycle of length greater than k is G(x)=1/(1-x) - exp(A(x)) where A(x)=Sum_{j=1..k}x^j/j.
a(n)/(2n)! is the coefficient of x^(2n) in G(x).
a(n) = Sum_{k=n+1..2n} C(2n,k)*(k-1)!*(2n-k)! - Geoffrey Critzer, Jun 01 2013
a(n) ~ sqrt(Pi)*log(2)*2^(2*n+1)*n^(2*n+1/2)/exp(2*n). - Vaclav Kotesovec, Sep 29 2013
EXAMPLE
a(2)=14 because there are 6 permutations of {1,2,3,4} that contain a cycle of length four and 8 that contain a cycle of length three. 6+8=14.
MAPLE
a:= proc(n) option remember; `if`(n<2, n,
(6-12*n+8*n^2)*a(n-1)-4*(n-1)^2*(2*n-3)^2*a(n-2))
end:
seq(a(n), n=1..20); # Alois P. Heinz, Jun 13 2013
MATHEMATICA
Drop[Table[a = Sum[x^j/j, {j, 1, n}]; Coefficient[Series[1/(1 - x) - Exp[a], {x, 0, 40}], x^(2 n)]*(2 n)!, {n, 1, 40}], -20]
CROSSREFS
KEYWORD
nonn
AUTHOR
Geoffrey Critzer, Dec 02 2011
STATUS
approved