Let be relatively prime positive integers (i.e., they have no common factors other than 1). Then we have the formula

The sum is 0 when .

- Prove this result by a geometric argument.
- Prove this result by an analytic argument.

*Proof.*We know by the previous exercise (1.11, #6) thatFurther, from this exercise (1.7, #4), we know

where number of interior lattice points, and number of boundary lattice points. We also know by the formula for the area of a right triangle that

Thus, we have,

Then, to calculate we note there are no boundary points on the hypotenuse of our right triangle (since and have no common factor). (This follows since if there were such a point then for some , but then we would have divides , contradicting that they have no common factor.) Thus, . So,

*Proof.*To derive the result analytically, first, by counting in the other direction we have,Then,

If na is divisible by b for some integer n (1<= n <=b), we can only conclude that a and b share some common factors greater than 1, not a divides b (I think you mean a is divisible by b in this case).