|
|
A331538
|
|
Number of functions f:[n]->[n] such that there exists a k such that |f^(-1)(k)| = k.
|
|
1
|
|
|
0, 1, 3, 16, 147, 1756, 25910, 453594, 9184091, 211075288, 5427652794, 154380255250, 4812088559014, 163110595450466, 5973198636395003, 235010723141883563, 9886231689434154971, 442799642855527526848, 21038043034795035118742, 1056802542597653892224802, 55962024535834950971809754
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
REFERENCES
|
P. Flajolet and R. Sedgewick, Analytic Combinatorics, 2009.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = n^n - n! * [z^n] Product_{k=1..n} (exp(z) - z^k/k!).
a(n) = n^n - n! * [z^n] Product_{k=1..n} (Sum_{q=0..k-1} z^q/q! + Sum_{q=k+1..n} z^q/q!).
|
|
EXAMPLE
|
For n = 0: a(0) = 0^0 - 0! [z^0] 1 = 0.
Functions from [2]->[2] are
* [1,1] - pre-images are [1,2] and [], no contribution
* [1,2] - pre-images are [1] and [2], pre-image of one has one element, one contribution
* [2,1] - pre-images are [2] and [1], pre-image of one has one element, one contribution
+ [2,2] - pre-images are [] and [1,2], pre-image of two has two elements, one contribution
= total contributions is three.
|
|
PROG
|
(PARI) a(n)={n^n - n!*polcoef(prod(k=1, n, exp(x + O(x*x^n)) - x^k/k!), n)} \\ Andrew Howroyd, Jan 19 2020
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|