Given $p,q$ to be primes where $p<q$ .
Show that the following marix has non-zero determinant, \begin{bmatrix} 1&2 & 2 & 2 &\dotso & 2\\ 2&q-p+1 & 1 & 1 &\dotso & 1\\ 2& 1 & q-p+1 & 1 & \dotso & 1\\2&1 & 1 & q-p+1 &\dotso & 1 \\ \dotso &\dotso & \dotso & \dotso & \dotso \\ \dotso & \dotso & \dotso & \dotso & \dotso \\ \dotso & \dotso & \dotso & \dotso &\dotso \\2&1 &1 &1 &\dotso & q-p+1 \end{bmatrix}
I am able to show that the submatrix of this matrix \begin{bmatrix}q-p+1 & 1 & 1 & 1 & \dotso & 1\\ 1 &q-p+1& 1 &\dotso & \dotso &1 \\ \dotso &\dotso & \dotso & \dotso & \dotso \\ \dotso & \dotso & \dotso & \dotso & \dotso \\ \dotso & \dotso & \dotso & \dotso &\dotso \\1 &1 &1 &\dotso & \dotso &q-p+1\end{bmatrix}
has determinant non-zero.
How I can show that the original matrix has determinant non-zero?
I tried using Laplace Expansion but not getting anything. Please help.
If you substract the $2$-times the first row from all other rows, then you see that the determinant of the full matrix is equal to the determinant of a matrix with diagonal entries $q-p-3$ and off-diagonal entries $-3$. This matrix can be written as $$ (q-p)I - 3 E, $$ where $E$ is the matrix with all entries one. The matrix $E$ of dimension $(n-1)\times (n-1)$ has eigenvalues $n-1$ (multiplicity 1) and $0$ (multiplicity $n-2$). Thus the matrix $(q-p)I - 3 E$ has eigenvalues $q-p-3n$ and $q-p$ with multiplicities. Hence the determinant of the original $n\times n$ matrix as product of the eigenvalues is $$ \det = (q-p-3(n-1))(q-p)^{n-2}. $$ This matrix is singular for, e.g., $n=2$, $p=2$, $q=5$, where the matrix is equal to $\pmatrix{1&2\\2& q-p+1}=\pmatrix{1&2\\2& 4}$