# Generalized notion of divisor function?

Divisor function $d(n,m)$ counts the number of $q\in\Bbb N$ with $b<q<m$ such that $n\bmod q\equiv0$.

Given $b>0$ what is the correct asymptotic, probabilistic and average case behavior of the function $f(n,m,b)$ that counts the number of $q\in\Bbb N$ with $b<q<m$ such that $n\bmod q\in[-b,b]$?

There is an evident estimate: $f(n)= \frac{1}{2} \sum_{i=-b}^{i=b} \tau (n+i) + O(b)$ .
P.S. That is for $f(n)=d(n,\sqrt{n})$ in your initial message.
• it is just number of divisors of $n$. – Pavel Kozlov Jun 5 '17 at 10:05