Asymptotic expansion for harmonic sum in two variables I am interested in determining an asymptotic formula for the double summation of $1/(ab)$, where $a$ is an odd integer ranging between 1 and $k/\sqrt{j}$, $b$ is an odd integer ranging between $a$ and $aj$, $j$ is a real number $>1$, and $k$ tends to infinity.  In symbols,
$$
\sum_{\substack{1 \leq a \leq k/\sqrt{j} \\ a \text{ odd}}} \sum_{\substack{a \leq b \leq aj \\ b \text{ odd}}} \frac{1}{ab}.
$$
For $j=1$, the result of the summation simply corresponds to the infinite harmonic sum of odd squares $1/1 + 1/9 + 1/25\ldots $, which yields $\pi^2/8$. 
For $j>1$, I obtained the formula $\tfrac{1}{4} \ln(k) \ln(j) + O(1)$. I am particularly interested in this $O(1)$ term. Plotting this term vs $j$ we obtain a discontinuous function, where the most evident discontinuities occur when $j$ is an odd integer.  For instance, setting $j=2$, the constant term is about $0.94$. It progressively decreases (with other discontinuities) to approximately $0.73$ as $j$ increases approaching $3$, but for $j=3$ it raises to about $1.14$. The abrupt increase observed for $j=3$ is equal to $\pi^2/24$ (and more generally, for any odd integer $j$, the term shows a discontinuity with an abrupt increase by $\pi^2/8/j$).  
Is there any way to express the values of this $O(1)$ term explicitly? Thank you.  
 A: Note that for $j>1$, you are getting values of $b$ that are rational multiples of the values of $a$ and for which $1\le b/a\le j$.  More specifically, the double sum over $a$ and $b$ can be replaced by a sum over particular rational numbers $p/q$ in $[1,j]$.  Ignore the dependence on $j$ in the first sum for now by working in a variable $K=k/\sqrt{j}$.  Then
$$
S(K,j)=\sum_{a\le K}^{\prime}\sum_{a \le b \le aj}^{\prime}\frac{1}{ab}=\sum_{p/q \in \mathcal{A}(j)}\sum_{a\le K}^{\dagger}\frac{1}{a\cdot (p/q)a}.
$$
The initial two sums ($\sum^{'}$) are restricted to odd integers.  The rational numbers in $\cal{A}(j)$ are those with odd numerators and denominators and in $[1,j]$.  The final sum ($\sum^{\dagger}$) is restricted to odd integers that are divisible by $q$, i.e., odd multiples of $q$.  Writing $a=c q$, we have
$$
S(K,j)=\sum_{p/q\in \mathcal{A}(j)}\frac{1}{pq}\sum_{c\le K/q}^{\prime}\frac{1}{c^2}.
$$
Note that the discontinuities are clearly identified here: when $j$ is equal to a specific rational number $p/q$ with odd numerator and denominator, there is a jump of size
$$
\frac{1}{pq}\sum_{c\le K/q}^{\prime}\frac{1}{c^2}\sim \frac{1}{pq}\left(\frac{\pi^2}{8}-\frac{q}{K}\right)=\frac{\pi^2}{8pq} + O\left(\frac{1}{k\sqrt{pq}}\right)
$$
as $k\rightarrow \infty$.  You've already identified the jumps of size $\pi^2/(8j)$ for odd integers $j$; the next largest jump should be at $j=5/3$, of size $\pi^2/120$.
