Denote (still) $n\times n$ [permutation matrices][1] by $\mathfrak{S}_n$. The ordinary transpose preserves this group.

Given $P\in\mathfrak{S}_n$, construct the $n\times n$ matrix ${}^tP$ according to the rules:

(1) leave the 4 rims unchanged (1st row, 1st column, last row, last column);

(2) [transpose][2] its $(n-2)\times(n-2)$-submatrix found by removing the 4 rims.

**Example.** 
$$A=\begin{pmatrix} 1&0&0&0\\0&0&0&1\\0&1&0&0\\0&0&1&0
\end{pmatrix} \rightarrow
{}^tA=\begin{pmatrix} 1&0&0&0\\0&0&1&1\\0&0&0&0\\0&0&1&0
\end{pmatrix}.$$
**Example.** 
$$B=\begin{pmatrix} 1&0&0&0\\0&0&0&1\\0&0&1&0\\0&1&0&0
\end{pmatrix} \rightarrow
{}^tB=\begin{pmatrix} 1&0&0&0\\0&0&0&1\\0&0&1&0\\0&1&0&0
\end{pmatrix}.$$ 
Notice that ${}^tB$ is a permutation while ${}^tA$ is not!

>**Question.** What is $a_n:=\#\{^{t}P\in\mathfrak{S}_n:\,\,P\in\mathfrak{S}_n\}$, for $\geq3$? Easy: $a_3=6$.

**Remark.** This is a modest case. We could easily generalize the question to transposing several submatrices.

[1]: http://mathworld.wolfram.com/PermutationMatrix.html
[2]: https://en.wikipedia.org/wiki/Transpose