9.5 The square of a natural number a, when divided by a natural number n, gives a remainder of 8. The cube of the number a, when divided by n, gives a remainder of 25. Find n.
Answer: $n=113$

Solution. Note that the number $x=a^{6}-8^{3}=(a^{2})^{3}-8^{3}=(a^{2}-8)(a^{4}+8a^{2}+64)$ is divisible by $n$. Also note that the number $y=a^{6}-25^{2}=(a^{3})^{2}-25^{2}=(a^{3}-25)(a^{3}+25)$ is divisible by $n$. Then the difference $x-y=(a^{6}-8^{3})-(a^{6}-25^{2})=625-512=113$ is divisible by $n$. The number 113 is a prime number, it has only two divisors: 1 and 113. Since by the condition $n>25$, then $n=113$.