ROSECODE 540
Lattice points on the trace 1
Given a rectangle with side = = and side = = . A curve is traced by point of the rectangle as point slides along the x-axis and point slides along the y-axis.
The curve with and is shown below.

There are 4 lattice points on the curve above. Let be the number of distinct lattice points on the curve with the rectangle side and . For example, , and .
Define . You are given , and .
Find .
The curve with

There are 4 lattice points
Define
Find