<s>[INST] How to solve these general $n \times n$ determinants? How would you solve these two general determinants?
$$
        \begin{vmatrix}
        2 & 1 & 0 & \cdots & 0 & 0 \\
        1 & 2 & 1 & \cdots & 0 & 0\\
        0 & 1 & 2 & \cdots & 0 & 0 \\
        \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\
        0 & 0 & 0 & \cdots & 2 & 1\\
        0 & 0 & 0 & \cdots & 1 & 2\\
        \end{vmatrix}
$$
$$
        \begin{vmatrix}
        3 & 2 & 2 & \cdots & 2 \\
        2 & 3 & 2 & \cdots & 2 \\
        2 & 2 & 3 & \cdots & 2 \\
        \vdots & \vdots & \vdots & \ddots & \vdots \\
        2 & 2 & 2 & \cdots & 3 \\
        \end{vmatrix}
$$
And if there are any tips for counting determinants of this type, please let me know :-)
 [/INST] For the second one, in general, if $$\Delta_n=\begin{vmatrix}
a & b & b & \ldots & b\\
b & a & b &  \ldots & b \\
b & b & a &  \ldots & b \\
\vdots&&&&\vdots\\
b & b & b &  \ldots & a
\end{vmatrix}.$$ First step $R_i\to R_i-R_n\;(i\ne n)$ implies $$\Delta_n=
\begin{vmatrix}
a & b & b & \ldots & b\\
b -a& a-b & 0 &  \ldots & 0 \\
b-a & 0 & a-b &  \ldots & 0 \\
\vdots&&&&\vdots\\
b -a& 0 & 0 &  \ldots & a
-b\end{vmatrix}.$$
Second step $C_1\to C_1+C_2+\cdots +C_n$ implies
$$\Delta_n=
\begin{vmatrix}
a +(n-1)b& b & b & \ldots & b\\
0 & a-b & 0 &  \ldots & 0 \\
0 & 0 & a-b &  \ldots & 0 \\
\vdots&&&&\vdots\\
0 & 0 & 0 &  \ldots & a
-b\end{vmatrix}=[a+(n-1)b](a-b)^{n-1}.$$
</s>