Can someone give me a hint how to solve \begin{align*} |A|=\begin{vmatrix} x & 1 & 0 & 0 & \cdots & 0 & 0 \\ n-1 & x & 2 & 0 & \cdots & 0 & 0 \\ 0 & n-2 & x & 3 & \cdots & 0 & 0 \\ 0 & 0 & n-3 & x & \cdots & 0 & 0 \\ \vdots & \vdots & \vdots & \vdots & & \vdots & \vdots \\ 0 & 0 & 0 & 0 & \cdots & 1 & x \\ \end{vmatrix}? \end{align*}
By adding to row 1 the rows from 2 to n ,I can see that $|A|$ has $x+n-1$ as a factor. And by trying $n=2,3,4$, I can deduce that $$|A|=(x^2-(n-1)^2)(x^2-(n-3)^2)\cdots (x^2-1^2)$$ if $n$ is even, and $$|A|=(x^2-(n-1)^2)(x^2-(n-3)^2)\cdots (x^2-2^2)x$$ if $n$ is odd. I tried hard to give a proof, but without any progress.
We set $x=0$ and show that $A$ has eigenvalues $\pm(n-1),\pm(n-3),\ldots$ by finding a matrix that diagonalizes it. The solution of the problem follows easily from there.
Let $P$ be the Pascal matrix defined by $$p_{ij} = {{j-1}\choose{i-1}} = \frac{(j-1)^{\underline{i-1}}}{(i-1)!}\,,$$ where we have used generalization of binomial coefficient, defined using falling factorials. For example, when $n=4$ we have $$P=\begin{bmatrix}1&1&1&1\\ 0&1&2&3\\ 0&0&1&2\\ 0&0&0&1\end{bmatrix}\,.$$ Let $S$ be diagonal matrix defined by $$s_{ii} = 2^{n-i}{n-1\choose i-1}\,.$$ Then matrix $$V = P^{-1}SP^T$$ is such that $V^{-1}AV$ is diagonal, with eigenvalues sorted in descending order.
Proof. To prove this claim, let $L$ be the lower triangle and $U$ be the upper triangle of matrix $A$. Also, let $D$ be diagonal matrix defined by $d_{ii}=n+1-2i$, so that its diagonal elements are eigenvalues sorted in descending order.
We start with equivalence $$V^{-1}AV=D \;\Leftrightarrow\; S^{-1}PAP^{-1}S = P^TDP^{-T}\,.$$
To simplify the last equality we will use the following three equalities $$PUP^{-1}=U\,,\quad PLP^{-1}=D+L-U\,,\quad PDP^{-1}=D-2U\,.$$ One can prove them by multiplying them from the right by $P$ and by comparing the resulting left and right hand side, using properties of binomial coefficient.
We sum the first two equalities to obtain $$PAP^{-1}=D+L\,.$$ We use the last and the first equality to obtain $$D=P^{-1}DP-2P^{-1}UP = P^{-1}DP-2U\,.$$ Adding $2U$ to the both sides of this equality and transposing gives $$P^TDP^{-T}=D+2U^T\,.$$
Now, we have $$V^{-1}AV=D \;\Leftrightarrow\; S^{-1}(D+L)S=D+2U^T \;\Leftrightarrow\; S^{-1}LS=2U^T \,.$$ The last equation can be seen to hold by multiplying it from the left by $S$ and comparing the resulting left and right hand side. This ends the proof.
The idea for solution came from the answer to this question.