Let $A$ be a $28 \times 28$ matrix whose $(i,j)$-th entry is $$ a_{ij} = \begin{cases} 28 &\text{if } i = j\\ -1 &\text{if } i \neq j \end{cases} $$ What is the inverse of this matrix?
I tried doing it by the adjoint method, but my resolution is wrong. First I tried finding the determinant of $A$, which I believe to be $\det(A) =28^{28}+27-14\cdot28^2-14$. Then, I tried finding the cofactor of $a_{ij}$ where $i=j$, which I believe is $\operatorname{cof}(28) =28^{27}-27-28^3$ and also the cofactor of $a_{ij} $ where $i\neq j$ which I calculated to be $\operatorname{cof}(-1)=28^{26}+27-1+27\cdot28$. Since the matrix is symmetric, I thought that the cofactor matrix is equal to the adjoint matrix, so the elements of the inverse matrix would be: $$a_{ii}^{-1}=\frac{\operatorname{cof}(28)}{\det(A)}$$ and $$a_{ij}^{-1}=\frac{\operatorname{cof}(-1)}{\det(A)}$$ where $i\neq j$. But this doesn't give the correct value. I think it might be a simple mistake, but I really can't find it so any help would be appreciated.