Solution:
Let gcd(a,b)=d, a=da′, b=db′. Then,
d2(a′+b′2)=1002.
Consider each divisor d of 100. Then, we need to find the number of solutions in coprime integers to a′+b′2=d21002. Note that every b′<100/d coprime to d21002 satisfies this equation, which is equivalent to being coprime to d100, so then there are φ(d100) choices for each d, except for d=100, which would count the solution (0,100). Then we just need ∑d∣nφ(d100)−1=100−1=99.
Solution 2:
Note that b must be at most 99 in order for a to be positive. Now we claim that each choice of b∈{1,2,…,99} corresponds to exactly one value of a that satisfies the equation.
To see why this is true, we rewrite the formula as
gcd(a,b)⋅a=(100−b)(100+b).
For any prime p, let vp(n) be the largest integer k such that pk∣n. We wish to show that once we fix b, the value vp(a) is uniquely determined for all p (which will give us a unique solution for a). Applying vp to both sides of the equation gives us
min(vp(b),vp(a))+vp(a)=vp(100−b)+vp(100+b)
We immediately see that there is at most one solution for vp(a) since the left-hand side increases with vp(a). Further, as we increment vp(a), the left-hand side takes on all even numbers up to 2vp(b), and then all integers larger than 2vp(b). So to show that a solution exists, we need to prove that the right-hand side is always either even or at least 2vp(b).
If vp(b)=vp(100), then vp(100−b)=vp(100+b)=min(vp(100),vp(b)). In this case, vp(100−b)+vp(100+b) is clearly even. Otherwise, assume vp(b)=vp(100). Then vp(100−b)≥vp(b) and vp(100+b)≥vp(b), so vp(100−b)+vp(100+b)≥2vp(b) as desired. Thus, there is always a unique solution for vp(a). Once we fix 1≤b≤99, the value of a is uniquely determined, so the answer is 99.