login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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
Darij Grinberg, Marko Riedel, Markus Scheuer, et al., Math.StackExchange, Number of functions f:[n]->[n] such that there exists an i such that |f^(-1)(i)| = i.
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!).
a(n) = n^n - A331537(n).
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
Sequence in context: A294003 A006058 A121588 * A306397 A264660 A362655
KEYWORD
nonn
AUTHOR
Marko Riedel, Jan 19 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 1 10:17 EDT 2024. Contains 372163 sequences. (Running on oeis4.)