What is the total number of matrices that are similar to the following matrix? 
What is the total number of matrices that are similar to \begin{pmatrix} 
0 & 0 \\
0 & 1 
\end{pmatrix} over $\mathbb{Z}_7$, that is, the finite field on $7$ elements $\{0,1,2,3,4,5,6\}$?

I know that total number of invertible matrices of order $2$ over $\mathbb{Z}_7$ is $2016$. From this how to proceed? 
 A: Two matrices in $M_2(\Bbb F_7)$ are similar if and only if they have equal minimal and equal characteristic polynomial, i.e., $A$ is similar to the given matrix if and only if  $\operatorname{tr}(A)=1$ and $\det(A)=0$. Now you can count easily the total number of such $A$. Take all matrices
$$
\begin{pmatrix} a & b \cr c & 1-a\end{pmatrix}
$$
with $a(1-a)=bc$ in $\Bbb F_7$. One has to avoid double counts.
A: Call your matrix $D$. Its two eigenvalues, $0$ and $1$, are distinct. Therefore a matrix $A$ is similar to $D$ if and only if it shares the same spectrum with $D$. In turn, it is similar to $D$ if and only if both its rank and trace are equal to $1$. This means $A=uv^T$ for some vectors $u$ and $v$ such that $v^Tu=1$. Normalise $u$ such that the first nonzero entry of $u$ is $1$. Then $A$ must take one of the following two forms, where $x,y,z$ are arbitrary scalars in $\mathbb F_7$:
$$
\pmatrix{1\\ x}\pmatrix{1-xy&y}\text{ or } \pmatrix{0\\ 1}\pmatrix{z&1}.
$$
These representations are unique and so it's a trivial matter to count them.
