General formula for $f(n)$ 
Let for $n\geq 3, C_n$ denote the $(2n) \times (2n)$ matrix such that all entries along the diagonal are $2$, all entries along the sub- and super-diagonal are $1$, all entries along the antidiagonal are $1$, all entries along the diagonals directly above and below the antidiagonal are $2$, and all other entries are zero.
Let $f(n) : \mathbb{N}\to\mathbb{N}, f(n) = \det(C_n)$ for $n\geq 3.$ Prove that $$f(n) = \begin{cases}0,&\text{if }n = 3k+2,\ k\in\mathbb{N}\\
3^n,& \text{otherwise}\end{cases}.$$

I'm not sure how to go about doing this. I tried cofactor expansion along the first column, but I couldn't make much progress. I can't seem to find a recursive relationship. So I just tried converting $C_n$ to an upper triangular matrix using row operations. This results in a matrix satisfying certain patterns, but I can't seem to find a way to prove why reducing the matrix always produces these patterns (I can prove that the $k$th diagonal entry of the resulting upper triangular matrix is $\frac{k+1}k,$ where $1\leq k\leq n$ but I can't deal with the other $n$ diagonal entries well).
 A: $\newenvironment{vsmatrix}{\left|\begin{smallmatrix}}{\end{smallmatrix}\right|}\def\mycolor#1{{\color{blue}#1}}$Denote by $D_n$ the determinant of the $2n × 2n$ matrix to be solved with $2$ replaced by $a$ and $1$ replaced by $b$. In the following calculation, rows to which Laplace's formula for determinants are applied are colored blue. If a determinant has no colored entry, it means the determinant after the next equal sign is derived by applying elementary transformations.$$
D_1 = \begin{vmatrix}a & b \\ b & a\end{vmatrix} = a^2 - b^2,\ D_2 = \begin{vmatrix}
a & b & a & b\\
b & a & b & a\\
a & b & a & b\\
b & a & b & a
\end{vmatrix} = 0,
$$\begin{align*}
D_3 &= \begin{vmatrix}
a & b &&& a & b\\
b & a & b & a & b & a\\
& b & a & b & a &\\
& a & b & a & b &\\
a & b & a & b & a & b\\
b & a &&& b & a
\end{vmatrix}
= \begin{vmatrix}
a & b &&& a & b\\
b & 0 & 0 & 0 & 0 & a\\
& b & a & b & a &\\
& a & b & a & b &\\
a & 0 & 0 & 0 & 0 & b\\
b & a &&& b & a
\end{vmatrix}
= \begin{vmatrix}
a & b &&& a & b\\
b & 0 & 0 & 0 & 0 & a\\
& \mycolor{0} & \mycolor{a} & \mycolor{b} & \mycolor{0} &\\
& \mycolor{0} & \mycolor{b} & \mycolor{a} & \mycolor{0} &\\
a & 0 & 0 & 0 & 0 & b\\
b & a &&& b & a
\end{vmatrix}\\
&= (a^2 - b^2) \begin{vmatrix}
a & b & a & b\\
b & 0 & 0 & a\\
a & 0 & 0 & b\\
b & a & b & a
\end{vmatrix}
= (a^2 - b^2) \begin{vmatrix}
0 & b & a & 0\\
\mycolor{b} & \mycolor{0} & \mycolor{0} & \mycolor{a}\\
\mycolor{a} & \mycolor{0} & \mycolor{0} & \mycolor{b}\\
0 & a & b & 0
\end{vmatrix}\\
&= -(a^2 - b^2)^2 \begin{vmatrix}b & a \\ a & b\end{vmatrix} = (a^2 - b^2)^3.
\end{align*}
For any $n \geqslant 4$,\begin{align*}
D_n &= \begin{vsmatrix}
⋱ & ⋱ &&&&& ⋰ & ⋰\\
⋱ & a & b &&& a & b & ⋰\\
& b & a & b & a & b & a &\\
&& b & a & b & a &&\\
&& a & b & a & b &&\\
& a & b & a & b & a & b &\\
⋰ & b & a &&& b & a & ⋱\\
⋰ & ⋰ &&&&& ⋱ & ⋱
\end{vsmatrix}_{2n × 2n}\mskip-18mu
= \begin{vsmatrix}
⋱ & ⋱ &&&&& ⋰ & ⋰\\
⋱ & a & b &&& a & b & ⋰\\
& b & 0 & 0 & 0 & 0 & a &\\
&& b & a & b & a &&\\
&& a & b & a & b &&\\
& a & 0 & 0 & 0 & 0 & b &\\
⋰ & b & a &&& b & a & ⋱\\
⋰ & ⋰ &&&&& ⋱ & ⋱
\end{vsmatrix}_{2n × 2n}\mskip-18mu
= \begin{vsmatrix}
⋱ & ⋱ &&&&& ⋰ & ⋰\\
⋱ & a & b &&& a & b & ⋰\\
& b & 0 & 0 & 0 & 0 & a &\\
&& \mycolor{0} & \mycolor{a} & \mycolor{b} & \mycolor{0} &&\\
&& \mycolor{0} & \mycolor{b} & \mycolor{a} & \mycolor{0} &&\\
& a & 0 & 0 & 0 & 0 & b &\\
⋰ & b & a &&& b & a & ⋱\\
⋰ & ⋰ &&&&& ⋱ & ⋱
\end{vsmatrix}_{2n × 2n}\\
&= (a^2 - b^2) \begin{vsmatrix}
⋱ & ⋱ &&&&& ⋰ & ⋰\\
⋱ & a & b &&& a & b & ⋰\\
& b & a & b & a & b & a &\\
&& b & 0 & 0 & a &&\\
&& a & 0 & 0 & b &&\\
& a & b & a & b & a & b &\\
⋰ & b & a &&& b & a & ⋱\\
⋰ & ⋰ &&&&& ⋱ & ⋱
\end{vsmatrix}_{2(n - 1) × 2(n - 1)}\mskip-54mu
= (a^2 - b^2) \begin{vsmatrix}
⋱ & ⋱ &&&&& ⋰ & ⋰\\
⋱ & a & b &&& a & b & ⋰\\
& b & 0 & b & a & 0 & a &\\
&& \mycolor{b} & \mycolor{0} & \mycolor{0} & \mycolor{a} &&\\
&& \mycolor{a} & \mycolor{0} & \mycolor{0} & \mycolor{b} &&\\
& a & 0 & a & b & 0 & b &\\
⋰ & b & a &&& b & a & ⋱\\
⋰ & ⋰ &&&&& ⋱ & ⋱
\end{vsmatrix}_{2(n - 1) × 2(n - 1)}\\
&= -(a^2 - b^2)^2 \begin{vsmatrix}
⋱ & ⋱ &&&&& ⋰ & ⋰\\
⋱ & a & b &&& a & b & ⋰\\
& b & a &&& b & a &\\
&& b & b & a & a &&\\
&& a & a & b & b &&\\
& a & b &&& a & b &\\
⋰ & b & a &&& b & a & ⋱\\
⋰ & ⋰ &&&&& ⋱ & ⋱
\end{vsmatrix}_{2(n - 2) × 2(n - 2)}\mskip-54mu
= -(a^2 - b^2)^2 \begin{vsmatrix}
⋱ & ⋱ &&&&& ⋰ & ⋰\\
⋱ & a & b &&& a & b & ⋰\\
& b & a &&& b & a &\\
&& \mycolor{0} & \mycolor{b} & \mycolor{a} & \mycolor{0} &&\\
&& \mycolor{0} & \mycolor{a} & \mycolor{b} & \mycolor{0} &&\\
& a & b &&& a & b &\\
⋰ & b & a &&& b & a & ⋱\\
⋰ & ⋰ &&&&& ⋱ & ⋱
\end{vsmatrix}_{2(n - 2) × 2(n - 2)}\\
&= (a^2 - b^2)^3 \begin{vsmatrix}
⋱ & ⋱ &&&&& ⋰ & ⋰\\
⋱ & a & b &&& a & b & ⋰\\
& b & a & b & a & b & a &\\
&& b & a & b & a &&\\
&& a & b & a & b &&\\
& a & b & a & b & a & b &\\
⋰ & b & a &&& b & a & ⋱\\
⋰ & ⋰ &&&&& ⋱ & ⋱
\end{vsmatrix}_{2(n - 3) × 2(n - 3)}\mskip-54mu
= (a^2 - b^2)^3 D_{n - 3}.
\end{align*}
Therefore,$$
D_n = \begin{cases}
(a^2 - b^2)^n; & n \not\equiv 2 \pmod{3}\\
0; & n \equiv 2 \pmod{3}
\end{cases}.
$$
A: First let us make a simplification: reverse the order of the last $n$ rows and the last $n$ columns. This does not affect the determinant, so we may suppose 
$$
C_n=
\begin{bmatrix}
A_n & B_n\\
B_n & A_n
\end{bmatrix}
$$
where $A_n$ is tridiagonal with parameters $(1,2,1)$ and $B_n$ is tridiagonal with parameters $(2,1,2)$.
Now by block row and column operations we see that
$$
\det C_n=
\det
\begin{bmatrix}
A_n & B_n\\
B_n & A_n
\end{bmatrix}
=
\det  
\begin{bmatrix}
A_n + B_n & B_n\\
B_n + A_n & A_n
\end{bmatrix}
=
\det  
\begin{bmatrix}
A_n + B_n & B_n\\
O & A_n - B_n
\end{bmatrix}.
$$
We therefore have
$$
\det C_n=
\det 3 G_n\
\det H_n
$$
where 
where $G_n$ is tridiagonal with parameters $(1,1,1)$ and $H_n$ is tridiagonal with parameters $(-1,1,-1)$.
Recall that $f(n)=\det C_n$.
Write $g(n)=\det G_n$ and $h(n)=\det H_n$. Let's put $f(0)=g(0)=h(0)=1$ for convenience. 
Then with the usual expansion of triadiagonal determinants (expand by first row, then expand second term by first column) we have that both $g(n)$ and $h(n)$ satisfy the recurrence 
$$
\phi(n+2)=\phi(n+1)-\phi(n)
$$
for all $n\geqslant 1$; it's easy to check this is also true for $n=0$.
Moreover $f(0)=g(0)=1$ and $f(1)=g(1)=1$, and with these initial conditions the recurrence has a unique solution: both $f(n)$ and $g(n)$ must cycle through the six values $(1,1,0,-1,-1,0)$. 
Then $3^{-n}f(n)=g(n)h(n)$ cycles through the three values $(1,1,0)$. This is exactly what we are asked to prove.  
Comment
The question would have been easier to tackle had the $2$s been replaced by $a$ and the $1$s by $b$; the answer is then $(a+b)^{n}(a-b)^{n}$ when $n\not\equiv 2\mod 3$, and $0$ when it is. 
