f(n)=n! ( 1/2! - 1/3! + 1/4! +..+(- 1)^n/n! )
The derivation process of this formula needs sieve formula, and the derivation process is very complicated. In addition to the competitive college entrance examination, enumeration method can be used when n is not greater than 4. Generally, you just need to remember that n is not greater than 5.
f(2)= 1,f(3)=2,f(4)=9,f(5)=44
There is also a simple formula f(n)={n! /e}, {x} represents the integer closest to x, and e is the natural base, and its value is 2.7 1828 18 ..., generally 2.72 is enough.