Given the matrix:
$$ A = \begin{pmatrix} x & 1 & 0 & 0 & \cdots & 0 & 0 \\ n - 1 & x & 2 & 0 & \cdots & 0 & 0 \\ 0 & n - 2 & x & 3 & \cdots & 0 & 0 \\ \vdots & \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & 0 & 0 & \cdots & x & n - 1 \\ 0 & 0 & 0 & 0 & \cdots & 1 & x \end{pmatrix} $$
How to find the determinant of $A$. I considered examples for $n = 3,4,5,6$ and obtained some expressions. But I can't understand what the expression for the general case.
I guess that the formula is like the following: $$ \det(A) = x^n - x^{n-2}\sum_{i = 1}^{n - 1}( i \cdot (n - i) ) + ... $$
Hint. The matrix in question is in the form of $xI+K$, where $K$ is a Kac matrix whose spectrum has a closed-form formula.