Consider a $n\times n$ matrix:
$$ M_n = \begin{pmatrix} a_1 & 1 & 0 & 0 & 0 & \cdots & 1 \\ 1 & a_2 & 1 & 0 & 0 & \cdots & 0 \\ 0 & 1 & a_3 & 1 & 0 & \cdots & 0 \\ \vdots & \vdots& \vdots& \vdots & \vdots& \vdots & \vdots \\ 0 & \cdots & \cdots & 0 & 1 & a_{n-1} & 1 \\ 1 & \cdots & \cdots & \cdots & \cdots & 1 & a_n \end{pmatrix} $$
where $a_k=2\cos(k\phi)+2\mathrm{i}\gamma\sin(k\phi)$, with $\phi=2\pi/n$ and $0<\gamma<1$. $~n\ge5$, and can be assumed to be prime numbers if necessary.
How to get its characteristic polynomial $P_n(x)=\det(M_n-xI)$?
$x^n$, $x^{n-2}$ and $x^0$ terms are easy to get, can you get other terms?