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).
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.