2. (12 points) Find a natural number $n$ such that the numbers $n+30$ and $n-17$ are squares of other numbers.
Answer: 546.

Solution. From the condition of the problem, it follows that $\left\{\begin{array}{l}n+30=k^{2} \\ n-17=m^{2}\end{array}\right.$. Subtracting the second equation from the first, we get $k^{2}-m^{2}=47(*)$ or $(k-m)(k+m)=47$. Since 47 is a prime number, the possible cases are $\left\{\begin{array}{l}k-m= \pm 1, \\ k+m= \pm 47\end{array}\right.$ or conversely $\left\{\begin{array}{l}k-m= \pm 47, \\ k+m= \pm 1,\end{array}\right.$ but for any case $k= \pm 24$. Then $n=24^{2}-30=546$. Verification: $n-17=546-17=529=23^{2}$.

Grading criteria. Full solution 12 points. If equation (*) is obtained, 6 points, if all possible cases for the factors are obtained, plus 3 points. If the solution process is correct but there are arithmetic errors, minus 2 points.