Let be $a,b\in\mathbb{N}$. Then, how many points with integers coordinates exist in the line segment created by $(a,0)$ and $(0,b)$?
I've already draw some expamples, but I can't find the relation between all of them. Probably something related to diophantine equations, divisibility, Euclides or something similar because these are the subjects we are studying right now.
Any help will be appreciated.
Write out the parametric equation of the segment in the complex plane: $$s_{a,b}(t) = at + ib(1-t) .$$ Obviously, $t=0$ and $t=1$ always lead to a Gaussian integer (a complex number with integer components), so we need to find conditions under which some $t\in(0,1)$ leads to a Gaussian integer as well.
Hints: What happens when $\gcd\{a,b\}=1$? What happens when $\gcd\{a,b\}\neq 1$?
Bonus points: how many Gaussian integers are there on $s_{a,b}$ when $\gcd\{a,b\} = n$?