|
FORMULA
|
a(n)=n!*sum(m=0,n,(-1^m/m!)*sum(j=0,n-m,C(n-m,j)/j!))
a(n)=(2n-1)a(n-1)-(n-1)(n-3)a(n-2)-(n-1)(n-2)a(n-3), a(0)=1, a(n)=0 if n<0
E.g.f. for number of partial bijections of an n-element set with exactly k fixed points is x^k/k!*exp(x^2/(1-x))/(1-x). [From Vladeta Jovovic (vladeta(AT)eunet.yu), Nov 09 2008]
|
|
EXAMPLE
|
a(3) = 18 because there are exactly 18 partial derangements (on a 3-element set), namely: the empty map, (1)->(2), (1)->(3), (2)->(1), (2)->(3), (3)->(1), (3)->(2), (1,2)->(2,1), (1,2)->(2,3), (1,2)->(3,1), (1,3)->(2,1), (1,3)->(3,1), (1,3)->(3,2), (2,3)->(1,2), (2,3)->(3,1), (2,3)->(3,2), (1,2,3)->(2,3,1), (1,2,3)->(3,1,2) - the mappings are coordinate-wise.
|