To solve the problem, we need to find the number of matrices \( A \) in the set \( T_p \) such that the trace of \( A \) is not divisible by \( p \) and the determinant of \( A \) is divisible by \( p \).
### Step-by-Step Solution:
1. **Understanding the Matrix and Its Properties**:
The matrix \( A \) is given as:
\[
A = \begin{pmatrix}
a & b \\
c & a
\end{pmatrix}
\]
where \( a, b, c \in \{0, 1, 2, \ldots, p-1\} \).
2. **Calculating the Trace and Determinant**:
The trace of \( A \) is given by:
\[
\text{trace}(A) = a + a = 2a
\]
The determinant of \( A \) is given by:
\[
\text{det}(A) = a \cdot a - b \cdot c = a^2 - bc
\]
3. **Conditions to Satisfy**:
We need:
- The trace \( 2a \) is not divisible by \( p \).
- The determinant \( a^2 - bc \) is divisible by \( p \).
4. **Analyzing the Trace Condition**:
For \( 2a \) to not be divisible by \( p \), \( a \) must not be equal to \( 0 \) (since \( p \) is an odd prime, \( 2a \equiv 0 \mod p \) only when \( a = 0 \)). Therefore, \( a \) can take any value from \( 1 \) to \( p-1 \). This gives us \( p-1 \) choices for \( a \).
5. **Analyzing the Determinant Condition**:
We need \( a^2 - bc \equiv 0 \mod p \). This implies:
\[
bc \equiv a^2 \mod p
\]
For each fixed value of \( a \), \( a^2 \) is a specific value in \( \{0, 1, 2, \ldots, p-1\} \).
6. **Choosing Values for \( b \) and \( c \)**:
- We can choose \( b \) freely from \( \{0, 1, 2, \ldots, p-1\} \), giving us \( p \) choices.
- For each choice of \( b \), \( c \) must be chosen such that \( bc \equiv a^2 \mod p \). This gives us exactly one choice for \( c \) for each \( b \) (since \( c \equiv \frac{a^2}{b} \mod p \) is well-defined as long as \( b \neq 0 \)).
7. **Counting the Total Matrices**:
- For \( a \), we have \( p-1 \) choices.
- For \( b \), we have \( p \) choices.
- For each \( b \), there is exactly one corresponding \( c \).
Therefore, the total number of matrices \( A \) that satisfy the conditions is:
\[
(p-1) \cdot p = p(p-1)
\]
### Final Answer:
The number of matrices \( A \) in \( T_p \) such that the trace of \( A \) is not divisible by \( p \) but the determinant is divisible by \( p \) is \( p(p-1) \).