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$
4. It is evident, the greatest common divisor of $n$ and $n+3$

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 $O A_{n}$ contains two integer points $(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$.