AIME 2017 I, Problem 2

When each of $702$, $787$, and $855$ is divided by the positive integer $m$, the remainder is always the positive integer $r$. When each of $412$, $722$, and $815$ is divided by the positive integer $n$, the remainder is always the positive integer $s \neq r$. Find $m+n+r+s$.

Solution: Let's work on both parts of the problem separately. First, \[855 \equiv 787 \equiv 702 \equiv r \pmod{m}.\] We take the difference of $855$ and $787$, and also of $787$ and $702$. We find that they are $85$ and $68$, respectively. Since the greatest common divisor of the two differences is $17$ (and the only one besides one), it's safe to assume that $m = 17$. Then, we divide $855$ by $17$, and it's easy to see that $r = 5$. Dividing $787$ and $702$ by $17$ also yields remainders of $5$, which means our work up to here is correct. Doing the same thing with $815$, $722$, and $412$, the differences between $815$ and $722$ and $412$ are $310$ and $93$, respectively. Since the only common divisor (besides $1$, of course) is $31$, $n = 31$. Dividing all $3$ numbers by $31$ yields a remainder of $9$ for each, so $s = 9$. Thus, $m + n + r + s = 17 + 5 + 31 + 9 = \fbox{62}$.

Answer: 62