Let $A = (a_{ij}) \in R^{n\times n}$. Find the determinant if:
$$a_{ij}= |i-j|$$
So we have the symmetric matrix \begin{bmatrix} 0 & 1 & 2 & 3 & 4 & \dots & n-1 \\ 1 & 0 & 1 & 2 & 3 & \dots & n-2 \\ 2 & 1 & 0 & 1 & 2 & \dots & n-3 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \ddots & \vdots \\ n-1 & n-2 & n-3 & \dots & \dots & \dots & 0 \end{bmatrix}
But i can't find a way to diagonalize the matrix nor find the determinant by Laplace expansion.
Any ideas ??
If we do row reduction, i.e. $R_n-R_{n-1}$, $R_{n-1}-R_{n-2}$, up to $R_2-R_1$, and then again do $R_n-R_{n-1}$, $R_{n-1}-R_{n-2}$, up to $R_3-R_2$ and finally $R_2+R_1$, then we get \begin{align} &\begin{vmatrix} 0 & 1 & 2 & 3 & 4 & \cdots & n-1 \\ 1 & 0 & 1 & 2 & 3 & \cdots & n-2 \\ 2 & 1 & 0 & 1 & 2 & \cdots & n-3 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \ddots & \vdots \\ n-1 & n-2 & n-3 & \cdots & \cdots & \dots & 0 \end{vmatrix}\\ \ \\ =&\begin{vmatrix} 0 & 1 & 2 & 3 & 4 & \cdots & n-1 \\ 1 & -1 & -1 & -1 & -1 & \cdots & -1 \\ 1 & 1 & -1 & -1 & -1 & \cdots & -1 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \ddots & \vdots \\ 1&1&1&\cdots&\cdots&-1&-1 \\ 1 & 1 & 1 & \cdots & \cdots & 1 & -1 \end{vmatrix}\\ \ \\ =&\begin{vmatrix} 0 & 1 & 2 & 3 & 4 & \cdots & n-1 \\ 1 & 0 & 1 & 2 & 3 & \cdots & n-1 \\ 0 & 2 & 0 & 0 & 0 & \cdots & 0 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \ddots & \vdots \\ 0&0&0&\cdots&2&0&0 \\ 0 & 0 & 0 & \cdots & \cdots & 2 & 0 \end{vmatrix}\\ \end{align} Now we calculate the determinant and its minors all by the last row: \begin{align} =&\begin{vmatrix} 0 & 1 & 2 & 3 & 4 & \cdots & n-1 \\ 1 & 0 & 1 & 2 & 3 & \cdots & n-1 \\ 0 & 2 & 0 & 0 & 0 & \cdots & 0 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \ddots & \vdots \\ 0&0&0&\cdots&2&0&0 \\ 0 & 0 & 0 & \cdots & \cdots & 2 & 0 \end{vmatrix}\\ \ \\ =&-2\begin{vmatrix} 0 & 1 & 2 & 3 & 4 & \cdots & n-1 \\ 1 & 0 & 1 & 2 & 3 & \cdots & n-1 \\ 0 & 2 & 0 & 0 & 0 & \cdots & 0 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \ddots & \vdots \\ 0&0&0&\cdots&\cdots&2&0 \\ \end{vmatrix}\\ \ \\ &=(-1)^{n-2}2^{n-2}\begin{vmatrix}0&n-1\\1&n-1 \end{vmatrix}\\ \ \\ &=(-1)^{n-1}2^{n-2}(n-1). \end{align}