Diagonalizing the X and Z matrices I've got two special matrices I'm trying to diagonalize : 
The Z matrix :$$\begin{bmatrix}
1&1&\cdots&1&1\
\\&&&1
\\&&\diagup
\\&1
\\1&1&\cdots&1&1
\end{bmatrix}$$ (all the other members are $0$)
And the X matrix :
$$\begin{bmatrix}
a&0&\cdots&0&b\
\\0&\ddots&&\diagup&0
\\\vdots&&&&\vdots
\\0&\diagup&&\ddots&0
\\b&0&\cdots&0&a
\end{bmatrix}$$
The member in the middle may be $a$ or $b$, it is not specified so I guess (?) the result doesn't depend on that.
The exercise does not say anything more, so I guess we have to do the cases $a,b\in\mathbb{R}$ and $a,b\in\mathbb{C}$.

PS : if possible, please replace the \diagup by the appropriated dots and remove this comment
 A: For the matrix $Z$, there is an eigenvalue $0$ associated with the eigenvector $e_1-e_n$ (where $n$ is the dimension of $Z$ and $e_i$ denotes the $i$th column of the identity matrix), an eigenvalue $2$ with the eigenvector $e_1+e_n$. Next, there an eigenvalue $1$ with the multiplicity $\lceil (n-2)/2\rceil$ and eigenvectors $e_1+e_n-\frac{1}{2}(e_{i+1}+e_{n-i})$, $i=1,\ldots,\lceil (n-2)/2\rceil$. Finally, the eigenvalue $-1$ has the multiplicity $\lfloor (n-2)/2\rfloor$ and corresponding eigenvectors $e_{i+1}-e_{n-i}$, $i=1,\ldots,\lfloor (n-2)/2\rfloor$.
Similarly for $X$.
There are two or three groups of eigenvalues (depending on whether the matrix dimension $n$ is even or odd). Try the eigenvectors $v_i=e_i+e_{n-i+1}$, $i=1,\ldots,\lfloor n/2\rfloor$, and $v_i=e_i-e_{n-i+1}$ for $i=\lceil n/2+1\rceil,\ldots,n$ corresponding to the eigenvalues $a+b$ and $a-b$. For $n$ odd, the "middle" eigenvector can be chosen simply to be $v_{\lceil{n/2}\rceil}=e_{\lceil{n/2}\rceil}$ with the eigenvalue equal to whatever is on the diagonal there.
