Recall that the number or Derangements of $1,2,\dots,n$ is a permutation $p$ such that $p(i) \neq i$ for all $i$. We can express it with the recurrence $D_n=(n-1)(D_{n-1}+D_{n-2})$ or by the closed formula $$D_n =\sum_{i=0}^n (-1)^i \frac{n!}{i!}$$
Now we consider the number of permutations of $1,2,\dots, n,n+1$ such that for all $1\leq i \leq n$ (not $n+1$), $p(i)\neq i$, but also $p(n+1) \neq n$. We need to express this number using $D_n$s.
I was thinking of first counting the number of permutations without the additional condition $p(n+1) \neq n$ and received using inclusion-exclusion
$$\sum_{r=0}^n (-1)^r \binom{n}{r}(n+1-r)! = \sum_{r=0}^n (-1)^r \frac{n!}{r!}(n+1-r) =$$ $$\sum_{r=0}^n (-1)^r \frac{(n+1)!}{r!}- \sum_{r=1}^n (-1)^r \frac{n!}{(r-1)!}=$$ $$\sum_{r=0}^n (-1)^r \frac{(n+1)!}{r!}- n\sum_{r=0}^{n-1} (-1)^{r+1} \frac{(n-1)!}{r!}=$$ $$=D_{n+1}+nD_{n-1}$$
Now we need to subtract from this the number of permutations when $p(n+1)=n$, which I wasn't able to count.
Thanks in advance