Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
One reason why the $n$th derangement number is very close to $n!/e$ is that the exponential generating function for the derangement numbers is $$\frac{e^{-z}}{1-z} = \frac{e^{-1}}{1-z} + g(z)$$ where $g(z)$ is an entire function, and therefore $g(z)$ has coefficients that are very small compared to the coefficients of $e^{-z}/(1-z)$. By the same reasoning, if $f(z)$ is an entire function, or even a function with radius of convergence greater than 1, then the coefficients of $f(z)/(1-z)$ will be very close to $f(1)$.
It seems likely that the formula might appear in Pólya's 1937 paper (on "Pólya's theorem") but I haven't checked this. It's also always a good idea to check Richard Stanley's Enumerative Combinatorics for anything on enumerative combinatorics.