Solution (source code)

= Solution

The Leibniz definition is
$$
\det A=\sum_{\pi\in S_n}\operatorname{sgn}(\pi)\prod_{i=1}^nA_{i,\pi(i)}.
$$
The adjugate is the transpose of the cofactor <matrix>. Cofactor expansion gives
$$
A\operatorname{adj}(A)=\operatorname{adj}(A)A=(\det A)I.
$$
For the displayed tridiagonal <matrix>, expansion along the last row gives $D_n=2D_{n-1}-D_{n-2}$, with $D_1=2,D_2=3$. Induction yields
$$
\boxed{\det A_n=D_n=n+1.}
$$