Solution (source code)

= Solution

In <Einstein notation>, $(\mathbf n\cdot\mathbf x)n_i=n_in_jx_j$, so the matrix and, for $\alpha\ne0$, its <matrix inverse> are
$$
\boxed{A_{ij}=\delta_{ij}+(\alpha-1)n_in_j,\qquad B_{ij}=\delta_{ij}+(\alpha^{-1}-1)n_in_j.}
$$