Inverse of matrix of ones + nI Having a vector $\mathbf{1} \in \mathbb{R}^{n}$ containing only ones, following equality should be true according to a paper I am currently reading:
\begin{equation}
  \left( nI+\mathbf{1}\mathbf{1}^T \right)^{-1}= \frac{1}{n}\left( I - \frac{1}{2n} \mathbf{1}\mathbf{1}^T \right)
\end{equation}
EDIT: what is the general rule for constructing an inverse of a matrix with $n$ on diagonal and $1$ elsewhere and how is this rule derived?

Example
Example for $n=5$:
$$
 \mathbf{A}(n) =
\left(
\begin{array}{ccccc}
 6 & 1 & 1 & 1 & 1 \\
 1 & 6 & 1 & 1 & 1 \\
 1 & 1 & 6 & 1 & 1 \\
 1 & 1 & 1 & 6 & 1 \\
 1 & 1 & 1 & 1 & 6 \\
\end{array}
\right), \qquad
\mathbf{A}^{-1}(n) =
\frac{1}{50}
\left(
\begin{array}{rrrrr}
 9 & -1 & -1 & -1 & -1 \\
 -1 & 9 & -1 & -1 & -1 \\
 -1 & -1 & 9 & -1 & -1 \\
 -1 & -1 & -1 & 9 & -1 \\
 -1 & -1 & -1 & -1 & 9 \\
\end{array}
\right)
$$
Result
In general,
$$
\mathbf{A}_{r,c}(n) =
\begin{cases}
 1 & r\ne c \\
 n+1 & r = c
\end{cases}
\qquad 
\mathbf{A}^{-1}_{r,c}(n) =
\begin{cases}
 -\frac{1}{2n^{2}} & r\ne c \\
 \frac{2n-1}{2n^{2}} & r = c
\end{cases}
$$
Proof strategy: induction
To compute the inverse matrix,
$$
\mathbf{A}^{-1} = \frac{\text{adj } \mathbf{A}} {\det \mathbf{A}}
$$
where the adjugate matrix, $\text{adj } \mathbf{A}$, is the transpose of the matrix of cofactors.


*

*Establish $\det \mathbf{A}(n) = 2n^{-2}$.

*Establish the matrix of minors is an $n\times n$ matrix of the form
$$
\left[ \begin{array}{rrrr}
  \alpha & \beta & -\beta & \dots \\
  \beta & \alpha & \beta & \dots \\
  -\beta & \beta & \alpha \\
  \vdots & \vdots & & \ddots 
\end{array} \right]
$$ 
with
$$
  \alpha = \left(2n-1 \right) n^{n-2}, \qquad \beta = n^{n-2}
$$
