Let An be the nn matrix which has 1's on the leading diagonal and on the diagonals immediatle above and below the leading diagonal. Let an = det(An).
Find a recurrent relation and generating function for the sequence an???
I have worked out the det, the sequence goes like this, 1,0,-1,-1,0,1,1,0,-1 etc. The generating function is "(1-x)/x^2-x+1"
The sequence $(a_n)_{n\geqslant1}$ is uniquely determined by the initial conditions $a_1=1$, $a_2=0$, and by the recursion $a_n=a_{n-1}-a_{n-2}$ for every $n\geqslant3$.
The initial conditions follow from the inspection of the determinants of $A_1=(1)$ and $A_2=\begin{pmatrix}1 & 1\\ 1 & 1\end{pmatrix}$. The recursion follows from an expansion of the determinant of $A_n$ along its first column. To wit, the only nonzero entries in the first column are the entries $(1,1)$ and $(1,2)$, the $(1,1)$ co-matrix is $A_{n-1}$, and the $(2,1)$ co-matrix has only one nonzero coefficient on its first line, whose co-matrix is $A_{n-2}$.
The generating function $A(x)=\sum\limits_{n\geqslant1}a_nx^n$ solves $$A(x)=x+\sum\limits_{n\geqslant3}(a_{n-1}-a_{n-2})x^n=x+x\sum\limits_{n\geqslant3}a_{n-1}x^{n-1}-x^2\sum\limits_{n\geqslant3}a_{n-2}x^{n-2}, $$ that is, $A(x)=x+x(A(x)-x)-x^2A(x)$, which yields $$A(x)=\frac{x(1-x)}{1-x+x^2}. $$