Find the asymptotic form as $N \rightarrow \infty$ of $\sum_{a = 1}^{N} \sum_{u = 1}^{a - 2} \sum_{v = u + 1}^{a - 1} {\delta}_{N = u\, a + v}$ Here $N \ge 1$ is a positive integer and $a$, $u$, and $v$ are also integers. This triple sum arises from counting the number of reducible cubic polynomials.  I am looking for a closed form solution if possible, or at least a reduction in one or two sums, but my main question is the asymptotic form as $N \rightarrow \infty$.  Now through different computations (taking the better part of a day) I have a table of values of this triple sum, its difference from $N$ and the asymptotic correction that I have identified through these numerical tests.  $$\left(\begin{array}{c c c c}
N & 
\text{Triple Sum} &
\text{N-TSum} &
2 \sqrt{N} \\ 
1 & 0 & 1 & 2 \\ 
10 & 3 & 7 & 6 \\ 
10^2 & 77 & 23 & 20 \\ 
10^3 & 930 & 70 & 63 \\ 
10^4 & 9{,}789 & 211 & 200 \\ 
10^5 & 99{,}351 & 649 & 632 \\ 
10^6 & 997{,}977 & 2{,}023 & 2{,}000 \\ 
10^7 & 9{,}993{,}645 & 6{,}355 & 6{,}324 \\ 
10^8 & 99{,}979{,}961 & 20{,}039 & 20{,}000 
\end{array}\right)$$
From this I see that the expected asymptotic form is now $$\begin{equation*}
\sum_{a = 1}^{N} \sum_{u = 1}^{a - 2} \sum_{v = u + 1}^{a - 1} {\delta}_{N = u\, a + v} \sim
N - 2 \sqrt{N}
+ \mathcal{O} \left({1}\right).
\end{equation*}$$
Where ${\delta}_{N = u\, a + v}$ is the KroneckerDelta function.  I could also use the Inversion Brackets as $\left[N=a\,u+v\right]$. So how do I prove this?
Picking up after the comments, then to complete the asymptotic expansion as $N \rightarrow \infty$ for the number of divisors, Kevin A. Broughan,
"Restricted divisors sums" Acta Arithmetica 101(2), pp105-114, 2002 defines the restricted number of divisors
${d}_{\alpha} \left({n}\right) = \# \left\{{d : d \mid n \text{ and } 1 \le d \le \alpha}\right\}$ for real
$\alpha \ge 1$.  Broughan furhter defines the sum of the restricted number of divisors as
$$D \left({x, \alpha}\right) =\sum_{1 \le n \le x} {d}_{\alpha} \left({n}\right)$$
with $1 \le \alpha \le x$.
From Broughan's Theorem 4.1 the asymptotic expansion as $x \rightarrow \infty$ of the sum of the restricted number of divisors is
$$D \left({x, \alpha}\right) \sim x\, \log \left({\alpha}\right) + \gamma\, x + O \left({\frac{x}{\alpha}}\right) + O \left({\alpha}\right)$$
Then as $N \rightarrow \infty$ we can now write the average number of divisors as
$$\sum_{u=2}^{\left \lfloor \frac{-3+\sqrt{4n+5}}{2} \right \rfloor} [n \mod u = 0] = {d}_{\left\lfloor{\left({\sqrt{4\, N + 5} - 3}\right)/2}\right\rfloor} \left({N}\right) - 1 = \frac{1}{N}\, D \left({N, \left\lfloor{\frac{1}{2} \left({ \sqrt{4\, N + 5} - 3}\right)}\right\rfloor}\right) \sim \frac{1}{2}\, \log \left({N}\right) + \gamma - 1 + O \left({\frac{1}{\sqrt{N}}}\right)$$
Now we can write
$$ S \sim N - 2 \sqrt{N} - \frac{1}{2}\, \log \left({N}\right) + O \left({1}\right)$$
 A: We can simplify the triple sum by rephrasing it to $$S = \sum_{a = 1}^{n} \sum_{u = 1}^{a - 2}  [u+1 \le n-ua \le a-1]$$
Now rearranging this, we get $$\sum_{a = 3}^{n} \sum_{u = 1}^{a - 2}  \left[\frac{n-a+1}{a} \le u \le \frac{n-1}{1+a} \right]$$
Now solve for $u$ in terms of $a$.  For each value of $u$ there will be $$\left \lfloor \frac{n-1-u}{u} \right\rfloor - \left\lceil \frac{n+1}{u+1} \right\rceil + 1$$ cases of $a$.  After finding the bounds, this can be simplified to $$\sum_{u=1}^{\left \lfloor \frac{-3+\sqrt{4n+5}}{2} \right \rfloor} \left( \left \lfloor \frac{n-1-u}{u} \right\rfloor - \left\lceil \frac{n+1}{u+1} \right\rceil + 1 \right)$$
Of course, this can be simplified to $$\sum_{u=1}^{\left \lfloor \frac{-3+\sqrt{4n+5}}{2} \right \rfloor} \left( \left \lfloor \frac{n-1}{u} \right\rfloor - \left\lceil \frac{n+1}{u+1} \right\rceil \right)$$
This turns into something that is sort of a telescoping series, $$S = n-1- \left\lceil \frac{n+1}{\left \lfloor \frac{-3+\sqrt{4n+5}}{2} \right \rfloor+1} \right\rceil+\sum_{u=2}^{\left \lfloor \frac{-3+\sqrt{4n+5}}{2} \right \rfloor} \left( \left \lfloor \frac{n-1}{u} \right\rfloor - \left\lceil \frac{n+1}{u} \right\rceil \right)$$
Using the fact that $\left \lfloor \frac{n-1}{u} \right\rfloor - \left\lceil \frac{n+1}{u} \right\rceil = -2$ if $n \pmod u = 0$ and $-1$ otherwise, the sum can be simplified further to $$S = n- \left\lceil \frac{n+1}{\left \lfloor \frac{-3+\sqrt{4n+5}}{2} \right \rfloor+1} \right\rceil - \left \lfloor \frac{-3+\sqrt{4n+5}}{2} \right \rfloor -\sum_{u=2}^{\left \lfloor \frac{-3+\sqrt{4n+5}}{2} \right \rfloor} [n \mod u = 0]$$
That last part is basically the number of divisors $u$ of $n$, with $2 \le u \le \left \lfloor \frac{-3+\sqrt{4n+5}}{2} \right \rfloor$. After getting rid of the floors and ceilings, we get that $$S \approx n - \sqrt{n} - \sqrt{n} + O(1) = n - 2\sqrt{n} - O(1)$$
