<s>[INST] 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}
 [/INST] Let $e_0, e_1, \ldots, e_6$ be the basis column vector with entries $1$ at $q^{th}$ row and zero otherwise. i.e
$$(e_q)_p = \begin{cases}1, & p = q\\0, & \text{ otherwise }\end{cases},\quad 0 \le p, q \le 6$$
Let $A$ be the matrix at hand. Let $L = (\ell_{pq})$ and $R = (r_{pq})$ be the $7 \times 7$ matrices given by
$$\ell_{qp} = r_{pq} = \begin{cases} 1, & p = q+1 \pmod 7\\0, & \text{ otherwise }\end{cases},\quad 0 \le p, q \le 6$$
$L$ and $R$ are matrices which shift the basis vector $e_q$ to $e_{q-1 \pmod 7}$
and $e_{q+1 \pmod 7}$ respectively.
In terms of $L$ and $R$, we have
$$A = a I_7 + L + R$$
It is easy to see $R = L^{T} = L^{-1}$ and $L$ has seven eigenvectors $u_0, u_1, \ldots, u_6$ of the form
$$u_p = \sum_{q=0}^6 e^{i\frac{2\pi pq}{7}} e_q\quad\iff\quad(u_p)_q = e^{i\frac{2\pi pq}{7}},\quad 0 \le q \le 6$$
with eigenvalue $e^{i\frac{2\pi p}{7}}$. This means $A$ has eigenvalues of the form $a + 2\cos\frac{2\pi p}{7}$ and
$$\det A = \prod_{p=0}^6 \left( a + 2\cos\frac{2\pi p}{7} \right)$$
Rewrite $a$ as $2\cosh\theta = e^\theta + e^{-\theta}$, we have
$$\begin{align}\det A 
&= e^{-7\theta}
\prod_{p=0}^6 \left(e^{2\theta}+1 + 2e^\theta\cos\frac{2\pi p}{7}\right)
= e^{-7\theta}\prod_{p=0}^6 \left(e^\theta + e^{i\frac{2\pi p}{7}}\right)\left(e^\theta + e^{-i\frac{2\pi p}{7}}\right)\\
&= e^{-7\theta}(e^{7\theta} + 1)^2
= 2\cosh(7\theta) + 2 = 2T_7(\frac{a}{2}) +2\\
&= a^7-7a^5+14a^3-7a+2
\end{align}
$$
where 
$T_n(x) = \cos(n\cos^{-1}(x)) = \cosh(n\cosh^{-1}(x))$ is the Chebyshev polynomial of first kind. 
</s>