How many positive integers $n$ are there such that the geometric and harmonic means of $n$ and 2015 are both integers?
Solution. $2015=5 \cdot 13 \cdot 31$. The fact that $\sqrt{2015 n}$ is an integer is equivalent to all prime powers in the canonical form of $2015 n$ having even exponents. This implies that $n=2015 k^{2}$, where $k$ is a positive integer.

Consider the harmonic mean. Using that $n=2015 k^{2}$, transform the following expression in this way:

$$
\frac{2}{\frac{1}{n}+\frac{1}{2015}}=\frac{2}{\frac{2015+n}{2015 n}}=\frac{2 \cdot 2015 n}{2015+n}=\frac{2 \cdot 2015 \cdot 2015 k^{2}}{2015+2015 k^{2}}=\frac{2 \cdot 2015 k^{2}}{1+k^{2}}
$$

If this number is an integer, then the denominator divides the numerator: $1+k^{2} \mid 2 \cdot 2015 k^{2}$. Since $1+k^{2}$ and $k^{2}$ are coprime, this can only be true if $1+k^{2} \mid 2 \cdot 2015$.

The divisors of $2 \cdot 2015=2 \cdot 5 \cdot 13 \cdot 31$ are: $1,2,5,10,13,26,31,62,65,95,130,310,403,806,2015,4030$. Only 2, 5, 10, 26, 65 can be of the form $1+k^{2}$. Each $k$ corresponds to an $n$ value, so there are a total of 5 such $n$ values.