What is the spectrum of this matrix? $$A_n=\begin{bmatrix}
1 & 1 & 1 & \cdots & 1 & 1\\
1 & 2 & 2 & \cdots & 2 & 2\\
1 & 2 & 3 & \cdots & 3 & 3\\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\
1 & 2 & 3 & \cdots & n-1 & n-1\\
1 & 2 & 3 & \cdots & n-1 & n
\end{bmatrix}.$$
What are the eigenvalues and the corresponding eigenvectors of $A_n$?
 A: Since the inverse of $A_n$ is 
$$
A^{-1}_n = \begin{pmatrix}
2 & -1 & 0 & \dots & 0 & 0\\
-1 & 2 & -1 & \dots & 0 & 0\\
0 & -1 & 2 & \dots & 0 & 0\\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots\\
0 & 0 & 0 & \dots & 2 & -1\\
0 & 0 & 0 & \dots & -1 & 1
\end{pmatrix}
$$
Solving $A_n^{-1} x = \lambda^{-1} x$ is the same that solving difference problem
$$\begin{aligned}
x_0 &= 0\\
-x_{k+1} + 2x_k -x_{k-1} &= \lambda^{-1} x_k, \quad k = 1, \dots, n-1\\
x_n - x_{n-1} &= \lambda^{-1} x_n
\end{aligned}
$$
Substituting $x_k = \sin \omega k$ gives following system of equations for $\omega, \lambda$
$$
4\sin^2\frac{\omega}{2} = \lambda^{-1}\\
(1-\lambda^{-1})\sin \omega n = \sin \omega (n-1)
$$
or
$$
1 - 4\sin^2\frac{\omega}{2} = \frac{\sin \omega(n-1)}{\sin \omega n}
$$
That equation has exactly $n$ different solutions for $\omega$ in $(0, \pi)$ since left is monotonically decreasing and right is increasing and has $n-1$ poles (see image for $n=5$). Values outside of $(0, \pi)$ produce the same values for $\lambda$ due to periodicity. So
$$
\lambda_j^{-1} = 4\sin^2\frac{\omega_j}{2}\\
(x_j)_k = \sin k \omega_j
$$ 

