Restricted divisor summatory function It is known that the average number of divisors, calculated over all positive integers between $1$ and $N$, can be expressed using the classical Dirichlet formula as
$$\frac{1}{N} \sum_{n=1}^N d(n)= \log(N)+2 \gamma -1+O(N^{-\frac{1}{2}})$$
where $\gamma$ is the Euler's constant and $d(n)$ is the divisor function. I would like to know whether there is a similar asymptotic formula if we restrict the calculation, for any $n$, to a narrower range for the divisors. In particular, given $n$, we can consider only the divisors $<c \sqrt{n}\,$, where $c$ is a positive real number.
Let us call this restricted divisor function $d(n,c)\,$. For $c=1\,\,$, the resulting summatory function trivially becomes 
$$\frac{1}{N} \sum_{n=1}^{N} d(n,1)= \frac{1}{2} \log(N)+ \gamma -\frac{1}{2}+O(N^{-\frac{1}{2}})$$
However, for $c \neq 1 \,$ I was not able to prove a general asymptotic formula. After some calculations, I guess that the constant term varies by $\log(c)$, but I would be happy to have a formal proof. 
 A: A simple change of summations gives a usable, albeit crude result:
$$\sum_{n=1}^N d(n,c) = \sum_{n=1}^N \sum_{\substack{d\mid n\\d<c\sqrt{n}}} 1 = \sum_{d=1}^{c\sqrt{N}} \sum_{\substack{d^2/c^2 < n \le N\\ n \equiv 0 \pmod d}} 1 = \sum_{d=1}^{\lfloor c\sqrt{N} \rfloor} \big\lfloor \frac{N}{d} \big\rfloor - \big\lfloor \frac{\lceil d^2/c^2 \rceil}{d} \big\rfloor \\
= \sum_{d=1}^{\lfloor c\sqrt{N} \rfloor} (\frac{N}{d} - \frac{d}{c^2}) + O(c\sqrt{N}) \\
= N(\log(c\sqrt{N}) + \gamma + O((c\sqrt{N})^{-1}) - (\tfrac12 N + O(c^{-1}\sqrt{N}) ) + O(c\sqrt{N}).$$
Thus the average value of $d(n,c)$ is $\frac12 \log N + \log c + \gamma - \frac12 + O_c(N^{-1/2})$, where the subscript in $O_c$ connotes that the implied constant may depend on $c$ (in this case it looks to be bounded by $O(c + c^{-1})$).  Perhaps the error term can be made more uniform in $c$ by refining this calculation via Dirichlet's hyperbola method.
A: For the special case when $c = 1$ then from Olivier Bordellès "On restricted divisor sums associated to the Chowla-Walum conjecture", International Journal of Number Theory, V18 #01, pp 19-25, 2022 we have a more accurate summation where
\begin{equation*}
\sum_{n \le x} \sum_{d \mid n, d \le \sqrt{n}} 1 \sim
\frac{1}{2}\, x\, \log \left({x}\right)
+ \frac{1}{2} \left({2\, \gamma - 1}\right) x
+ \frac{1}{2} \sqrt{x}
+ O \left({{x}^{{\theta}_{0} + \epsilon}}\right).
\end{equation*}
where for $x$ sufficiently large and all $\epsilon \in \left({0, 1/2}\right]$
\begin{equation*}
{\theta}_{\alpha} = 
\frac{1}{2}\, \alpha +
\begin{cases}
\frac{1}{4}, & \text{ if the Chowla-Walum conjecture is true}, \\
\frac{517}{1{,}648}, & \text{ otherwise}.
\end{cases}
\end{equation*}
The average sum becomes
\begin{equation*}
\frac{1}{x} \sum_{n \le x} \sum_{d \mid n, d \le \sqrt{n}} 1 \sim
\frac{1}{2}\, \log \left({x}\right)
+ \frac{1}{2} \left({2\, \gamma - 1}\right)
+ \frac{1}{2} \frac{1}{\sqrt{x}}
+ O \left({{x}^{{\theta}_{0} - 1 + \epsilon}}\right).
\end{equation*}
