Putnam 2018, Problem A-1

Find all ordered pairs $(a,b)$ of positive integers for which
\[
\frac{1}{a} + \frac{1}{b} = \frac{3}{2018}.
\]

Solution:
By clearing denominators and regrouping, we see that the given equation is equivalent to
$$(3a-2018)(3b-2018)=2018^2.$$
Each of the factors is congruent to 1 (mod 3). There are 6 positive factors of $2018^2=2^2\cdot1009^2$ that are congruent to 1 (mod 3): 1, $2^2$, 1009, $2^2\cdot1009$, $1009^2$, $2^2\cdot1009^2$. These lead to the 6 possible pairs: $(a,b)=(673,1358114)$, $(674,340033)$, $(1009,2018)$, $(2018,1009)$, $(340033,674)$, and $(1358114,673)$.

As for negative factors, the ones that are congruent to 1 (mod 3) are $-2,-2\cdot1009,-2\cdot1009^2$. However, all of these lead to pairs where $a\leq0$ or $b\leq0$.