For integers $a$ and $b$ consider the complex number \[\frac{\sqrt{ab+2016}}{ab+100}-\left(\frac{\sqrt{|a+b|}}{ab+100}\right)i.\] Find the number of ordered pairs of integers $(a,b)$ such that this complex number is a real number.
If $ab+2016\ge0$, the number is real iff $a+b=0$, so $a^2\le2016$ gives $89$ pairs, minus $a=\pm10$ (where $ab+100=0$): $87$.
If $ab+2016<0$, the first term is imaginary, and the number is real iff $-(ab+2016)=|a+b|$. For $a+b>0$, $(a+1)(b+1)=-2015$; for $a+b<0$, $(a-1)(b-1)=-2015$.
$2015=5\cdot13\cdot31$ has $8$ divisors; in each case exactly $8$ ordered factorizations have the right sign of $a+b$. Total $87+16=103$. The answer is $\boxed{103}$.
For integers $a$ and $b$ consider the complex number \[\frac{\sqrt{ab+2025}}{ab+100}-\left(\frac{\sqrt{|a+b|}}{ab+100}\right)i.\] Find the number of ordered pairs of integers $(a,b)$ such that this complex number is a real number.