I have a list of n points(2D): P1(x0,y0), P2(x1,y1), P3(x2,y2) … Points satisfy the condition that each point has unique coordinates and also the coordinates of each point
Taking B as an independent parameter, you can solve the fitting for A using least-squares, and compute the fitting residual.
The residue function is complex, with numerous minima of different value, and an irregular behavior. Anyway, if the Xi are integer, the function is periodic, with a period related to the LCM of the Xi.
The plots below show the fitting residue for B varying from 0 to 2 and from 0 to 10, with the given sample points.
