Let $a_{n}$ denote the integer closest to $\sqrt{n}$. What is the value of the following sum?

$$
\frac{1}{a_{1}}+\frac{1}{a_{2}}+\ldots+\frac{1}{a_{1980}}
$$
$$
\frac{1}{a_{1}}+\frac{1}{a_{2}}+\ldots+\frac{1}{a_{1980}}
$$

Solution. Since $\sqrt{n}$ is never equal to $\left(k+\frac{1}{2}\right)$ for any integer $k$, the definition of $a_{n}$ is unambiguous. Let's examine when $a_{n}=k$ for a given positive integer $k$. According to the definition of $a_{n}$ and the above, this is precisely when

$$
k-\frac{1}{2}<\sqrt{n}<k+\frac{1}{2}
$$

Since we are dealing with positive quantities, squaring them does not change the direction of the inequality:

$$
k^{2}-k+\frac{1}{4}<n<k^{2}+k+\frac{1}{4}
$$

Considering that $n$ and $k$ are integers, (2) holds precisely when

$$
k^{2}-k<n \leq k^{2}+k
$$

The inequality obtained holds for $k^{2}+k-\left(k^{2}-k\right)=2 k$ integers, so the number $k$ appears exactly $2 k$ times in the product $a_{n}$.

Since 1980 is exactly of the form $k^{2}+k$ (for $k=44$), if $1 \leq k \leq 44$, then $\frac{1}{k}$ appears exactly $2 k$ times among the terms of the sum (1), and there are no further terms.

Therefore, the value of the sum is $44 \cdot 2=88$.