Java 8, 151 111 110 101101 98 bytes
n->{int r=0,x=10000,i;for(;x-->0;r-=i-n>>-1)for(i=x;i-->1;)if>1&&(x>=i*i&x%i<1){x<i*i|x%i>0||(i=x/i-i;break;}returni)>i););return r;}
-10 bytes thanks to @Nevay.
-3 bytes thanks to @ceilingcat.
n->{ // Method with integer as parameter and return-type
int r=0, // Result-integer, starting at 0
x=10000, // Index-integer `x` for the outer loop, starting at 10,000
i; // Another indexIndex-integer `i` for the inner loop, uninitialized
for(;x-->0; // Loop (1)`x` fromin 10,000the downrange to(10000, 00]:
r-=i-n>>-1) // If the MaxMin-Divisor Pair's difference is lower than the input,
// add 1 to the result (after every iteration)
for(i=x, // Set `i` to `x`
ii=x;i-->1;)>1 // Inner loop (2)`i` fromin `i`the downwardsrange to(`x`, 11]:
if &&(x>=i*ix<i*i // If the current square-root of `x``i` is smaller than or equalequals to `i``x`,
&x%i<1){ |x%i>0 // and if the current `x` is divisible by `i`:
||(i=x/i-i; i)// Calculate the MaxMin-Division difference
break;} // And leave the inner loop (2>i)
;); // End of inner loop (2)And (implicitstop /the single-lineinner body)loop
return r;} // End of loop (1) (implicit / single-lineAfter body)
the loops, return r; // Return the result
} // End of method