Question 37: Let $\mathrm{p}>3$ be a prime number, and the set $M=\{1,2, \ldots, p-1\}$. Denote
$$
T=\left\{\left(n, x_{n}\right): p \mid\left(n x_{n}-1\right) \text {, and } n 、 x_{n} \in M\right\}
$$

Find $\sum_{\left(\mathrm{n}, x_{n}\right) \in \mathrm{T}} \mathrm{n}\left[\frac{\mathrm{nx}}{\mathrm{p}}\right]$ modulo $\mathrm{p}$, the smallest non-negative residue.
Question 37:
Proof: It is clear that for any $n \in M$, there exists a unique $x_{n} \in M$ such that $\left(n, x_{n}\right) \in T$. For any $\left(n, x_{n}\right) \in T$, let $s_{n}=\left[\frac{n x_{n}}{p}\right]=\frac{n x_{n}-1}{p}$. We need to find $S=\sum_{\left(n, x_{n}\right) \in T} n s_{n}$ modulo $p$.

For any $n \in M$, we have $p-n \in M, p-x_{n} \in M$, and
$$
(p-n)\left(p-x_{n}\right) \equiv(-n)\left(-x_{n}\right) \equiv 1(\bmod p)
$$

Thus, $x_{p-n}=p-x_{n}$. Consequently, $s_{p-n}=\frac{(p-n)\left(p-x_{n}\right)-1}{p}=p-\left(n+x_{n}\right)+\frac{n x_{n}-1}{p}=p-\left(n+x_{n}\right)+s_{n}$. Therefore,
$$
\begin{array}{l}
(p-n) \cdot s_{p-n}=(p-n)\left[p-\left(n+x_{n}\right)+s_{n}\right] \\
\Rightarrow(p-n) \cdot s_{p-n} \equiv n\left(n+x_{n}-s_{n}\right)=n^{2}+n x_{n}-n s_{n} \equiv n^{2}+1-n s_{n}(\bmod p)
\end{array}
$$

Thus,
$$
\begin{array}{l}
\sum_{n=1}^{p-1}(p-n) \cdot s_{p-n} \equiv \sum_{n=1}^{p-1} n^{2}+(p-1)-\sum_{n=1}^{p-1} n s_{n}(\operatorname{modp}) \\
\Rightarrow S \equiv \frac{(p-1) p(2 p-1)}{6}+(p-1)-S \equiv(p-1)-S(\bmod p) \\
\Rightarrow S \equiv \frac{p-1}{2}(\bmod p)
\end{array}
$$

In conclusion, $\sum_{\left(n, x_{n}\right) \in \mathrm{T}} \mathrm{n}\left[\frac{\mathrm{n} \mathrm{x}_{n}}{\mathrm{p}}\right]$ modulo $\mathrm{p}$ is $\frac{\mathrm{p}-1}{2}$.