2. Let $n>1$ be a positive integer. Consider the numbers $\frac{1}{n}, \frac{2}{n}, \cdots, \frac{n-1}{n}$ in their simplest forms. Let $f(n)$ denote the sum of the numerators of these simplest fractions. If $f(n)$ and $f(2015 n)$ have different parities, find all possible values of $n$.

---

The translation preserves the original text's line breaks and formatting.
2. $n$ is all positive integers greater than 1.

Let $n=2^{t} m(t \geqslant 0,(m, 2)=1)$.
Consider the simplest form of the fraction $\frac{k}{n}$, its numerator is even if and only if $2^{t+1} \mid k$.

From $1,2, \cdots, n-1$ there are exactly $\frac{m-1}{2}$ multiples of $2^{t+1}$, thus
$$
f(n) \equiv n-1-\frac{m-1}{2}(\bmod 2) .
$$

Therefore, $f(n)$ is even if and only if $n-1$ and $\frac{m-1}{2}$ have the same parity, i.e.,
$m \equiv 1(\bmod 4), n$ is odd;
$m \equiv 3(\bmod 4), n$ is even.
Note that, $n$ has the same parity as 2015, $m$ and $2015 m$ are not congruent modulo 4.
Hence, $f(n)$ and $f(2015 n)$ have different parities.