Answer
See explanation
Work Step by Step
matrix. The MATLAB command is $\mathbf{A}_{4}=$ ones (4) eye (4) . For the inverse use $\operatorname{inv}\left(\mathbf{A}_{4}\right)$
$\left[\begin{array}{cccc}0 & 1 & 1 & 1 \\ 1 & 0 & 1 & 1 \\ 1 & 1 & 0 & 1 \\ 1 & 1 & 1 & 0\end{array}\right], \quad A_{4}^{-1}=\left[\begin{array}{cccc}-2 / 3 & 1 / 3 & 1 / 3 & 1 / 3 \\ 1 / 3 & -2 / 3 & 1 / 3 & 1 / 3 \\ 1 / 3 & 1 / 3 & -2 / 3 & 1 / 3 \\ 1 / 3 & 1 / 3 & 1 / 3 & -2 / 3\end{array}\right]$
$A_{5}=\left[\begin{array}{ccccc}0 & 1 & 1 & 1 & 1 \\ 1 & 0 & 1 & 1 & 1 \\ 1 & 1 & 0 & 1 & 1 \\ 1 & 1 & 1 & 0 & 1 \\ 1 & 1 & 1 & 1 & 0\end{array}\right], \quad A_{5}^{-1}=\left[\begin{array}{ccccc}-3 / 4 & 1 / 4 & 1 / 4 & 1 / 4 & 1 / 4 \\ 1 / 4 & -3 / 4 & 1 / 4 & 1 / 4 & 1 / 4 \\ 1 / 4 & 1 / 4 & -3 / 4 & 1 / 4 & 1 / 4 \\ 1 / 4 & 1 / 4 & 1 / 4 & -3 / 4 & 1 / 4 \\ 1 / 4 & 1 / 4 & 1 / 4 & 1 / 4 & -3 / 4\end{array}\right]$
$A_{6}=\left[\begin{array}{cccccc}0 & 1 & 1 & 1 & 1 & 1 \\ 1 & 0 & 1 & 1 & 1 & 1 \\ 1 & 1 & 0 & 1 & 1 & 1 \\ 1 & 1 & 1 & 0 & 1 & 1 \\ 1 & 1 & 1 & 1 & 0 & 1 \\ 1 & 1 & 1 & 1 & 1 & 0\end{array}\right], \quad A_{6}^{-1}=\left[\begin{array}{cccccc}-4 / 5 & 1 / 5 & 1 / 5 & 1 / 5 & 1 / 5 & 1 / 5 \\ 1 / 5 & -4 / 5 & 1 / 5 & 1 / 5 & 1 / 5 & 1 / 5 \\ 1 / 5 & 1 / 5 & -4 / 5 & 1 / 5 & 1 / 5 & 1 / 5 \\ 1 / 5 & 1 / 5 & 1 / 5 & -4 / 5 & 1 / 5 & 1 / 5 \\ 1 / 5 & 1 / 5 & 1 / 5 & 1 / 5 & -4 / 5 & 1 / 5 \\ 1 / 5 & 1 / 5 & 1 / 5 & 1 / 5 & 1 / 5 & -4 / 5\end{array}\right]$
The construction of $A_{6}$ and the appearance of its inverse suggest that the inverse is related to $I_{6} .$ In fact, $A_{6}^{-1}+I_{6}$ is $1 / 5$ times the $6 \times 6$ matrix of ones. Let J denotes the nn matrix of ones. The conjecture is
\[
A_{n}=J-I_{n}
\]
and
\[
A_{n}^{-1}=\frac{1}{n-1} \cdot J-I_{n}
\]
\[
J^{2}=n J
\]
\[
A_{n} J=(J-1) J^{2}-J=(n-1) J
\]
Now compute
\[
A_{n}\left((n-1)^{-1} J-I\right)=(n-1)^{-1} A_{n} J-A_{n}=J-(J-I)=I
\]
since $A_{n}$ is square, An is invertible and its inverse is
\[
(n-1)^{-1} J-I
\]