4、Calculate: $\sum_{n=0}^{502}\left[\frac{305 n}{503}\right]=$ $\qquad$ , where $[x]$ denotes the greatest integer not exceeding the real number $x$.

保留源文本的换行和格式，翻译结果如下：

4、Calculate: $\sum_{n=0}^{502}\left[\frac{305 n}{503}\right]=$ $\qquad$ , where $[x]$ denotes the greatest integer not exceeding the real number $x$.
Solution: 76304.
Since 503 is a prime number, for $n=1,2, \cdots, 502, \frac{305 n}{503}$ is not an integer, but
$$
\frac{305 n}{503}+\frac{305(503-n)}{503}=305
$$

It can be seen that the sum of the fractional parts of the two numbers on the left side of the above equation is 1, therefore
$$
\left[\frac{305 n}{503}\right]+\left[\frac{305(503-n)}{503}\right]=304
$$

Thus,
$$
S=\sum_{n=1}^{502}\left[\frac{305 n}{503}\right]=\sum_{n=1}^{251}\left(\left[\frac{305 n}{503}\right]+\left[\frac{305(503-n)}{503}\right]\right)=304 \times 251=76304
$$