How to compute the determinant of $D_n$? Let 
\begin{align*}
D_n = \begin{pmatrix}
a & 0 & b & 0 & 0 & \cdots & b & 0 \\
0 & a & 0 & b & 0 & \cdots & 0 & b \\
b & 0 & a & 0 & b & \cdots & 0 & 0 \\
0 & b & 0 & a & 0 & \ddots & 0 & 0 \\
0 & 0 & b & 0 & a & \ddots & b & 0 \\
\vdots &  \vdots &  \vdots &  \ddots &  \ddots & \ddots &  \vdots &   \vdots \\
b & 0 & 0 & 0 & b & \cdots & a & 0 \\
0 & b & 0 & 0 & 0 & \cdots & 0 & a     
\end{pmatrix}.
\end{align*}
In $D_n=(d_{ij})$, $d_{ii} = a$ for all $1 \leq i \leq n$,  $d_{ij} = b$ for $|j-i|=2$ and $d_{n-1,1} = d_{n,2} = d_{1,n-1} = d_{2,n}=b$ for $n \geq 6$.
It is easy to compute $|D_1| = a$, $|D_2| = a^2$, $|D_3| = a (a^2 - b^2)$, $|D_4| = (a^2 - b^2)^2$, $|D_5| = a^5 - 3a^3 b^2 + 2 a b^4$.  How to compute $|D_n|$?
Thanks to Semiclassical pointing that $n \geq 6$, $D_n$ is a circulant matrix .

This is a circulant matrix with associated polynomial $f(x)=a+bx^2+bx^{n-2}$; the definition, as well as the result used below, can be found in the Wikipedia link. The eigenvectors/eigenvalues of a circulant matrix can be written down explicitly, and from the latter the determinant can be found. In the present case, we specifically have 
$$|D_n|=\prod_{j=0}^{n-1}f(e^{2\pi i j/n})=\prod_{j=0}^{n-1}(a+be^{4\pi i j/n}+be^{2\pi ij(n-2)/n})=\prod_{j=0}^{n-1}(a+2b\cos(4\pi j/n))$$ where the fact that $e^{2\pi i j}=1$ for any integer $j$ has been used to simplify the exponentials.
