7. The number $n+2015$ is divisible by 2016, and the number $n+2016$ is divisible by 2015. Find the smallest natural $n$ for which this is possible.

ANS: 4058209.
Solution. According to the condition $\left\{\begin{array}{l}n+2015=2016 m, \\ n+2016=2015 k .\end{array}\right.$ From this, $2016 m-2015 k=-1$. The solution of this equation in integers: $m=-1+2015 p, k=-1+2016 p$. Therefore, $n+2015=2016(-1+2015 p)=-2016+2016 \cdot 2015 p$, which means $n=-2015-2016+2016 \cdot 2015 p$. The smallest natural $n$ is $2016 \cdot 2015-2015-2016=2015^{2}-2016=4058209$.

Lomonosov Moscow State University

## School Olympiad "Conquer Sparrow Hills" in Mathematics

Final stage tasks for the 2015/2016 academic year for 9th grade