Find a set $C(N)$ of $n \times n$ matrices that commute with $\it{N}$ I have a $n \times n$ matrix $N$, where $n \in \mathbb{N}$.
$N =  \begin{bmatrix} 
0 & 1 & 0 & \dots & 0 & 0 \\
0 & 0 & 1 & \dots & 0 & 0 \\
0 & 0 & 0 & \dots & 0 & 0\\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\
0 & 0 & 0 & \dots & 0 & 1  \\
0 & 0 & 0 & \dots & 0 & 0\end{bmatrix}$
Determine a set $C(N)$ that contains all the $n \times n$ matrices that commute with $N$
I have tried defining some matrix $A$ and taking its $j$ column $A_j$ and then tried to multiply it with vector $e_j = \begin{bmatrix} 0 & \dots & 0 & 1 & 0 & \dots & 0 \end{bmatrix}^T$, that has $1$ only on index $j$, so things would maybe simplify, but then I get completely lost. I would really need an explanation on this. 
 A: Note that the $i,j$ entry of $A$ is given by $A_{ij} = e_i^TAe_j$.  Note that
$$
Ne_1 = 0, \qquad N e_i = e_{i-1} \quad i = 2,\dots,n\\
N^Te_n = 0, \qquad N^T e_i = e_{i+1} \quad i = 1,\dots,{n-1}.
$$
Finally, we have
$$
[AN]_{ij} = e_i^TANe_j = e_i^TA(Ne_j) \\
[NA]_{ij} = e_i^TNAe_i = (N^Te_i)^TA e_j.
$$
Now, if $[AN]_{ij} = [NA]_{ij}$, what can we say about the entries of $A$?  As a hint, you should separately consider the equations above for the case that $i > j$, then consider the case where $i \leq j$.
A: Consider a generic matrix $A=(a_{i,j})_{i,j}$ and impose $AN=NA$. You have to be very careful, but you obtain these condition:
\begin{equation}
AN=
\left[
\begin{matrix}
0 & a_{1,1} & a_{1,2} & \cdots & \cdots & a_{1,n-1}\\
0 & a_{2,1} & a_{2,2} & \cdots & \cdots & a_{2,n-1}\\
0 & a_{3,1} & a_{3,2} & \cdots & \cdots & a_{3,n-1}\\
\vdots & & & & & \vdots\\
\vdots & & & & & \vdots\\
0 & a_{n-1,1}& a_{n-1,2} & \cdots & \cdots & a_{n-1,n-1}\\
0 & a_{n,1} & a_{n,2} & \cdots & \cdots & a_{n,n-1}\\
\end{matrix}
\right]
=\left[
\begin{matrix}
a_{2,1} & a_{2,2} & a_{2,3} & \cdots & \cdots &  a_{2,n}\\
a_{3,1} & a_{3,2} & a_{3,3} & \cdots & \cdots & a_{3,n}\\
a_{4,1} & a_{4,2} & a_{4,3} & \cdots & \cdots & a_{4,n}\\
\vdots & & & & & \vdots\\
\vdots & & & & & \vdots\\
a_{n,1} & a_{n,2} & a_{n,3} & \cdots & \cdots & a_{n,n-1}\\
0 & 0 & 0 & \cdots & \cdots &  0\\
\end{matrix}
\right] =NA
\end{equation}
Reading these conditions along the diagonals you can observe that $a_{i,j} = a_{i+1,j+1}$ for all $i,j$ admitted. In particular you have that $A$ is upper triangular of this form:
\begin{equation}
\left[
\begin{matrix}
b_1 & b_2 & b_3 & \cdots & \cdots &  b_n\\
0 & b_1 & b_2 & \cdots & \cdots & b_{n-1}\\
0 & 0 & b_1 & \cdots & \cdots & b_{n-2}\\
\vdots & & & & & \vdots\\
\vdots & & & & & \vdots\\
0 & 0 & 0 & \cdots & \cdots & b_{2}\\
0 & 0 & 0 & \cdots & \cdots &  b_1\\
\end{matrix}
\right]
\end{equation}
A: If one has seen this before one knows that the answer is
$$
C(N)=
\left\{
f(N) | f\in K[X]
\right\}
$$
where $K$ is the underlying field. 
This is easy to check if $n=2$. One can then check that it holds in general by using induction: first block the matrices with $(n-1)\times (n-1)$ block and $1\times 1$ block on the diagonal; then block the matrices with $1\times 1$ block then $(n-1)\times (n-1)$ block on the diagonal. These will overlap, and so all patches together nicely. 
