Problem:
For integers a and b consider the complex number
ab+100ab+2016​​−(ab+100∣a+b∣​​)i
Find the number of ordered pairs of integers (a,b) such that this complex number is a real number.
Solution:
The complex number is real if either ab+100ab+2016​​ is real and ab+100∣a+b∣​​=0 or ab+100ab+2016​​ is imaginary and equals ab+100∣a+b∣​​i. In the former case, a=−b, and ab+100ab+2016​​ must be real. This will occur if and only if ab+2016≥0 and abî€ =−100. So a2≤2016, and there are 2⋅⌊2016​⌋+1−2=87 possible values for a (including 0, and excluding ±10). In the latter case, ab+2016​=−∣a+b∣​. If a+b>0, then ab+2016=−(a+b), which can be rewritten as (a+1)(b+1)=−2015=−5â‹…13â‹…31. There are 8 integer solutions to this equation with a+b>0. Similarly if a+b<0, then ab+2016=a+b, which can be rewritten as (a−1)(b−1)=−2015. Again, there are 8 integer solutions to this equation with a+b<0. This yields a total of 87+8+8=103​ possible ordered pairs.