Here's an intutive explanation:
Suppose you want to find the no.of derangements of n then:
T(n) = total possible permutations - ( let 1 element be at it's proper place and rest are deranged + let 2 elements be at their proper place and rest are deranged + ......+ except one all elements at their proper place which is same as saying that all elements at their proper place)
T(n) = n! - (nC1 * T(n-1) + nC2 * T(n-2) + ... + 1)
Applying the eqn here
T(2) = 1
T(3) = 3! - ( 3C1*T(2) + 1)
Similarly you can find T(4) and T(5).