A lattice point is a point with integer coordinates. (For example, $(1,4)$ is a lattice point but $\left(\frac{3}{2}, 4\right)$ is not.) The line $y=3 x-5$ passes through square $P Q R S$ as shown in the diagram. If the coordinates of $R$ are $(2009,2009)$, then the number of lattice points on the line which are inside the square is
(A) 666
(B) 667
(C) 668
(D) 669
(E) 670

![](https://cdn.mathpix.com/cropped/2024_04_20_e85ef69091c57cb633f3g-088.jpg?height=415&width=458&top_left_y=2042&top_left_x=1294)
We count the lattice points by starting with the point closest to $P S$ and proceeding to just below $Q R$.

For a lattice point $(a, b)$ on the line $y=3 x-5$ to be above $P S$, we need $b \geq 0$ or $3 a-5 \geq 0$ or $3 a \geq 5$ or $a \geq \frac{5}{3}$.

Since $a$ is an integer, then $a \geq 2$. $(a=2$ gives the point $(2,1)$.)

For a lattice point $(a, b)$ on the line $y=3 x-5$ to be below $Q R$, we need $b \leq 2009$ or $3 a-5 \leq 2009$ or $3 a \leq 2014$ or $a \leq \frac{2014}{3}$.

Since $a$ is an integer, then $a \leq 671$. $(a=671$ gives the point $(671,2008)$.)

Thus, for a lattice point $(a, b)$ to be on the line and inside the square, it must have $2 \leq a \leq 671$.

In fact, every such integer $a$ gives a lattice point, because it gives an integer value of $b=2 a-5$. The number of such integers $a$ is $671-1=670$, so there are 670 such lattice points.

ANSWER: (E)