Only a partial answer for now, as it is too long for a comment. From my comment and Carlo Beenakker's answer, it suffices to consider the case where $n$ and $m$ have different radicals but the same parity.
Write $n=\prod_{l=1}^{r_{n}}p_{l}^{\alpha_{l}}$ and $m=\prod_{l=1}^{r_{m}}p_{l}^{\beta_{l}}$.
Let $g:=gcd(n,m)$ where $n<m$, $n'=n/g$ and $m'=m/g$ and write $g=\prod_{l=1}^{r_{g}}p_{l}^{\gamma_{l}}$.
The idea is to consider that there are three different classes of integers greater than $1$ and below $n$: non trivial divisors of $n$ making the class $D_{n}$, integers coprime with $n$ and greater than $1$ making the class $C_{n}$ and "mixed" integers that can be uniquely written as a product of elements of the two previous classes, making the class $M_{n}$.
Denote by $F(a):=\{a\sum_{k=2}^{a-1}\frac{1}{k}\}$. The goal is to prove that the sum over the $k$ that are greater than $g-1$ of the $\frac{1}{k}$ give rise to different denominators depending on the value of $a$, namely $n'$$n$ or $m'$$m$.