Differences of MaxMin Divisor Pairs (DMDP) Let's talk about divisors...
Leaving out perfect squares (for a moment), all positive integers can be expressed as the product of 2 of their divisors. Quick example for 126: Here are all the divisors of 126

As you can see all the divisors can be paired. Here are what we will call the Divisor Pairs:
[1, 126], [2, 63], [3, 42], [6, 21], [7, 18], [9, 14]
For this challenge we will need only the last pair of this list (which is the center pair of the picture):
[9,14].We will call this pair the MaxMin Divisor Pair.
The Difference of MaxMin Divisor Pair (DMDP) is the difference of the two elements of the pair which is [9,14]=5
One more example for 544. The divisors are:

[1, 2, 4, 8, 16, 17, 32, 34, 68, 136, 272, 544]

and DMDP(544)=15  because 32-17=15
What about the perfect squares? All perfect squares have DMDP=0
Let's take for example 64 with divisors

{1, 2, 4, 8, 16, 32, 64}

As you can see in this case the MaxMin Divisor Pair is [8,8] which has DMDP=0
we are almost done..
The Challenge
Given an integer n&gt;0, output how many integers less than or equal to 10000, have DMDP less than n
Test Cases
input -&gt; output
1-&gt;100 (those are all the perfect squares)
5-&gt;492  
13-&gt;1201
369-&gt;6175  
777-&gt;7264  
2000-&gt;8478  
5000-&gt;9440  
9000-&gt;9888  
10000-&gt;10000   
20000-&gt;10000
  

This is code-golf.Shortest answer in bytes wins.
JavaScript (ES7), 60 bytes

f=(n,i=1e4,j=i**.5|0)=&gt;i?i%j?f(n,i,j-1):(i/j-j&lt;n)+f(n,i-1):0


Probably exceeds your recursion limit, so you might prefer the iterative version for 70 bytes:

n=&gt;[...Array(1e4)].map(g=(j=++i**.5|0)=&gt;i%j?g(j-1):k+=i/j-j&lt;n,i=k=0)|k