How many ways can you list numbers $1,2,3,...,n$ so that no number $i$ is in its $ith$ place on the list?
For example, $1,3,2,4$ is not a valid list since $1$ is in $1st$ place.
How many ways can you list numbers $1,2,3,...,n$ so that no number $i$ is in its $ith$ place on the list?
For example, $1,3,2,4$ is not a valid list since $1$ is in $1st$ place.
The problem statement you just proposed is just no. of dearrangement, which is well Known.Look here for detailslink