Placing $5$ pieces on a $5\times5$ grid with no main diagonal

In general, this number is equal to the number $D_n$ of derangements of $n$ elements: for any derangement $f:[1,n]\to[1,n]$ you get a placement $(i,f(i))$.
The known formulas for $D_n$ are: $$D_n=n!\sum_{j=0}^n\frac{(-1)^j}{j!}=\left\lfloor\frac{n!}e+\frac12\right\rfloor=\left[\frac{n!}e\right]$$ There is also a recursive formula, which one can easily prove: $$D_{n+1}=n\left(D_{n}+D_{n-1}\right)$$ In particular, $D_5=44$.


44 ways. Below is the complete list of such combination.

enter image description here

I did it by a brute force approach, I am trying to derive a formula for this.