Is there a closed formula for the inverse of an $N\times N$ matrix $M$ whose matrix elements are $m_{ij} = \delta_{ij} + c$, where c is a real constant?
Notice that this matrix can also be written as $M = I + c v v^T$, where $v$ is a vector defined by $v_i =1$ for $i=1,\ldots,N$.
You can use Taylor expansion
$$(I+cvv^{t})^{-1}=\frac{1}{I+cvv^{t}}=\sum_{n=0}^{\infty}\left(-cvv^{t}\right)^{n}$$
Observe that $$\left(vv^{t}\right)^{0}=I$$ $$\left(vv^{t}\right)^{1}=vv^{t}$$ $$\left(vv^{t}\right)^{2}=vv^{t}vv^{t}=Nvv^{t}$$ $$\vdots$$ $$\left(vv^{t}\right)^{n}=N^{n-1}vv^{t},\:\: n\geq1$$
So
$$\color{blue}{(I+cvv^{t})^{-1}}=I+\sum_{n=1}^{\infty}\left(-c\right)^{n}N^{n-1}vv^{t}=$$ $$=I-cvv^{t}\sum_{n=1}^{\infty}\left(-cN\right)^{n-1}=I-cvv^{t}\sum_{n=0}^{\infty}\left(-cN\right)^{n}=$$ $$=I-cvv^{t}\frac{1}{1+cN}=\color{blue}{I-\frac{c}{1+cN}vv^{t}}$$