How many derangements on a set $[n]$ does there exist such that $\sigma(n)\ne n-1$ ,$\sigma(n-1)\ne n-2$,$\sigma(n-2)\ne n-3$
Define : $$ \zeta_{n}=\left\{\sigma \in S_n:\forall k \in [n]:\sigma(k) \ne k , \sigma(n)=n-1\right\}$$
$$ \zeta_{n-1}=\left\{\sigma \in S_n:\forall k \in [n]:\sigma(k) \ne k ,\sigma(n-1)=n-2\right\}$$
$$ \zeta_{n-2}=\left\{\sigma \in S_n:\forall k \in [n]:\sigma(k) \ne k ,\sigma(n-2)=n-3\right\}$$
Then we want : $$!n-\left( \bigcup_{i=0}^{2}\zeta_{n-i}\right)$$ Which is equivalent to :
$$!n-\zeta_{n}-\zeta_{n-1}-\zeta_{n-2}+\zeta_{n}\cap \zeta_{n-1}+\zeta_{n}\cap \zeta_{n-2}+\zeta_{n-1}\cap \zeta_{n-2}-\zeta_{n}\cap \zeta_{n-1} \cap \zeta_{n-2}$$
The size of the sets $\zeta_{n},\zeta_{n-1},\zeta_{n-2}$ are the same and is equal to $\frac{D_n}{n-1}$.
For $\zeta_{n}\cap \zeta_{n-1}$ there are two cases,depending on whether $\sigma(n-2)=n$ or not we have $D_{n-3}+D_{n-2}$ selections.
For $\zeta_{n-1}\cap \zeta_{n-2}$ there are two cases,depending on whether $\sigma(n-3)=n-1$ or not we have$D_{n-3}+D_{n-2}$ selections.
For $\zeta_{n}\cap \zeta_{n-2}$ there are eight cases:
Either $\sigma(n-1)=n,\sigma(n-3)=n-2$ or $\sigma(n-1)=n,\sigma(n-3)\ne n-2$ or $\sigma(n-1) \ne n,\sigma(n-3)=n-2$ or $\sigma(n-1) \ne n,\sigma(n-3)\ne n-2$. The other cases are the same but we explore the permutations on $\sigma(n-1)=n-2,\sigma(n-3)=n$,gathering all of them gives $2\left(D_{n-4}+2D_{n-3}+D_{n-2}\right)$ cases.
Now consider $\zeta_{n}\cap \zeta_{n-1} \cap \zeta_{n-2}$,depending on whether $\sigma(n-3)=n$ or not we have $D_{n-4}+D_{n-3}$ selections.
So summing the cases gives the answer:$$D_n-3\frac{D_n}{n-1}+D_{n-3}+D_{n-2}+2\left(D_{n-4}+2D_{n-3}+D_{n-2}\right)+D_{n-3}+D_{n-2}-D_{n-4}-D_{n-3}$$ Which is equivalent to:
$$D_n-3\frac{D_n}{n-1}+5D_{n-3}+4D_{n-2}+D_{n-4}$$ I'm not sure if the answer is right,so can someone check that?(I have not tried to rewrite the last expression in its simplest form).