determinant of the $7\times7$ matrix How to find determinant of the following $7\times7$ matrix
\begin{bmatrix} 
    a&1&0&0&0&0&1&\\
    1&a&1&0&0&0&0&\\
    0&1&a&1&0&0&0&\\
    0&0&1&a&1&0&0&\\
    0&0&0&1&a&1&0&\\
    0&0&0&0&1&a&1&\\
    1&0&0&0&0&1&a&
\end{bmatrix}

An elementary proof. Let $J$ be the permutation matrix $(1\rightarrow 7,2\rightarrow 1,3\rightarrow 2\cdots)$; clearly $J^7=I$. Then we consider the matrix $A=aI+J+J^{-1}$. Let $\Delta_p=J^p+J^{-p}$ and $X=J+J^{-1}$.
$X^7=2I+7\Delta_5+21\Delta_3+35\Delta_1$. We remove $\Delta_5$:
$X^5=\Delta_5+5\Delta_3+10\Delta_1$ implies $X^7-7X^5=2I-14\Delta_3-35\Delta_1$.
We remove $\Delta_3$: $X^3=\Delta_3+3\Delta_1$ implies $X^7-7X^5+14X^3=2I +7\Delta_1$, that is
$f(X)=X^7-7X^5+14X^3-7X-2I=0$. Note that $f(x)=(x-2)(x^3+x^2-2x-1)^2$ (in irreducible factors).
Clearly $2$ is an eigenvalue of $X$. Then the characteristic polynomial of $X$ is $(x-2)^4(x^3+x^2-2x-1)$ or $f(x)$; in fact, it is $f(x)$ because $trace(X)=0$.
Conclusion: the required determinant is $-f(-a)=a^7-7a^5+14a^3-7a+2$.
