4. In the coordinate plane, a point whose both coordinates are integers is called an integer point. For any natural number $n$, connect the origin $O$ with the point $A_{n}(n, n+3)$, and 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$
4. It is evident 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 by
$$
\frac{m}{l}=\frac{n}{n+3}, \quad m(n+3)=l n .
$$

It follows that $n \mid m$, which contradicts $m<n$.
When $(n, n+3)=3$, let $n=3 k$, then there are two integer points in $O A_{n}$: $(k, k+1),(2 k, 2 k+2)$.
Therefore,
$$
\sum_{i=1}^{1990} f(i)=2 \times\left[\frac{1990}{3}\right]=1326 .
$$

Where $[x]$ represents the greatest integer not exceeding the real number $x$.