(cross-posted from Math SE)
For a given integer $b \geq 1$, let $D_b(m)$ be the number of positive divisors of $m$ that are less than $b$, and let $d_b(m)$ be the number of divisors of $m$ that are congruent to 1 modulo $b$. Then the inequality
$$ \sum_{b=1}^{n-1} D_b(-b^2+nb-1) > \sum_{b=1}^{n-1} (d_b(b^2+nb+1) - 2) $$
holds for all integers $n \geq 3$. (An almost proof is sketched below.) My question is: is there a different proof, especially a more direct proof, than the one below?
I note that the term corresponding to n and b on the left can sometimes be less than the corresponding term on the right. A computer search shows examples of this appearing for larger and larger n, although it seems that for most b and n, the term on the left is the bigger one.
Here is the sketch of how I think it may be proved:
Neil Sloane has suggested that the number of binary quadratic forms $Ax^2 + Bxy + Cy^2$ with integral coefficients and discriminant of the form $n^2-4$ and satisfying $A > 0$, $C > 0$, and $B > A+C$ is equal to
$$ \sum_{b=1}^{n-1} D_b(b^2-nb+1) $$
This is the only gap in the "almost" proof, but I think this is probably not too hard to prove.
On the other hand, I can prove that for each integer $n \geq 1$, the sum
$$ \sum_{b=1}^{n-1} (d_b(b^2+nb+1) - 2) $$
is equal to the number of binary quadratic forms of discriminant $n^2-4$ of the form $(st+1)x^2 + (rst+r+s+t)xy + (rs+1)y^2$ with integers $r$, $s$, $t > 0$. Since these forms are a subset of the earlier set of forms, the inequality above follows.