For my research, I am looking for the determinant of a square matrix with the form
\begin{bmatrix} x+1 & 2 & 2 & 1 & \dots & 1 & 1 \\ 2 & x+1 & 1 & 2 & \dots & 1 & 1 \\ 2 & 1 & x+1 & 1 & \dots & 1 & 1 \\ 1 & 2 & 1 & x+1 & \dots & 1 & 1 \\ \vdots & \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ 1 & 1 & 1 & 1 & \dots & x+1 & 2 \\ 1 & 1 & 1 & 1 & \dots & 2 & x+1 \\ \end{bmatrix}
where $x$ is an integer greater than $1$, and the dimension of the matrix is $x^2+x-1.$ For example when $x=2$, the matrix becomes \begin{bmatrix} 3 & 2 & 2 & 1 & 1 \\ 2 & 3 & 1 & 2 & 1 \\ 2 & 1 & 3 & 1 & 2 \\ 1 & 2 & 1 & 3 & 2 \\ 1 & 1 & 2 & 2 & 3 \\ \end{bmatrix} I start by adding every other row to the first, then dividing the now all $(x+1)^2$ row by $(x+1)^2$, so that I can subtract the resulting all-ones row from every other row. \begin{bmatrix} 1 & 1 & 1 & 1 & 1 \\ 1 & 2 & 0 & 1 & 0 \\ 1 & 0 & 2 & 0 & 1 \\ 0 & 1 & 0 & 2 & 1 \\ 0 & 0 & 1 & 1 & 2 \\ \end{bmatrix} After this, I am stuck on what to do for the general case of $x$. Any ideas would be appreciated.