4. In the coordinate plane, points with both coordinates as integers are called integer points. For any natural number $n$, connect the origin $O$ with the point $A_{n}(n, n+3)$. Let $f(n)$ denote the number of integer points on the line segment $O A_{n}$, excluding the endpoints. Then $f(1)+f(2)+$ $\cdots+f(1990)=$ $\qquad$ .
1326
4. 【Analysis and Solution】It is easy to see that the greatest common divisor of $n$ and $n+3$ is
$$
(n, n+3)=\left\{\begin{array}{l}
3, \text { when } 3 \mid n \\
1, \text { when } 3 \nmid n
\end{array}\right.
$$

When $(n, n+3)=1$, there are no integer points in $O A_{n}$. Otherwise, let $(m, l)$ be an integer point inside $O A_{n}$, $1 \leqslant m<n, 1 \leqslant l<n+3$, then from
$\frac{m}{l}=\frac{n}{n+3}, m(n+3)=l n$ we deduce that $n \mid m$, which contradicts $m<n$.
When $(n, n+3)=3$, let $n=3 k$, then $O A_{n}$ contains two integer points $(k, k+1),(2 k, 2 k+2)$, so $\sum_{i=1}^{1990} f(i)$ $=2 \times\left[\frac{1990}{3}\right]=1326$.
Here $[x]$ represents the greatest integer not exceeding the real number $x$.