In a mock test for an entrance exam I am preparing for came the following question:
Let $p$ be an odd prime number and $T_p$ be the following set of matrices
$$ T_p= \left( A=\begin{bmatrix} a & b \\ c & a\\ \end{bmatrix}:a,b,c\in(0,1,2\ldots,p-1) \right) $$
The number of $A$ in $T_p$ such that the trace of A is not divisible by $p$ but $det(A)$ is divisible by $p$ is, (the answer is in terms of p)
Here's what I have done so far:
Trace of $A=2a$.
Clearly, trace of A will be divisible by p iff $a=0$
$\Rightarrow \qquad a\in(1,2,\ldots,p-1)$
We have $det(A)={a^2}-bc$
So $\quad p\;|\;det(A)\Rightarrow \quad p\;|\;{a^2}-bc \qquad (1) $
Now how do I find out the number of ordered pairs $(b,c)$ which will satisfy condition $(1)$ for each value of $a\in(1,2,\ldots,p-1)$
For each choice of $a$ and $b$, there is a unique choice of $c$ such that $p \mid a^2-bc$ (that is, $c = a^2 b^{-1}$). It follows that there are $(p-1)^2$ such triplets $(a,b,c)$ and $p-1$ pairs $(b,c)$ for a given choice of $a$.