Item 1.7.17.d.

Note that being surjective here is the same as being injective, so we can start with all \(5!\) injective functions and subtract those which have one or more “fixed point”. We get \(5! - \left[{5 \choose 1}4! - {5 \choose 2}3! + {5 \choose 3}2! - {5 \choose 4}1! + {5 \choose 5} 0!\right]\) functions.

in-context