I received a calendar with daily math problems as a Christmas gift, and so far most of the problems have been fun and challenging but not too difficult. However, I am completely stumped on the one for today, January 31. The problem reads:
What is the largest positive integer $n$ such that $n^3+89$ is divisible by $n+5$?
I struggled with it for a bit and found a few $n$'s which worked before throwing it at a computer. I tested up to $n=200,000$ and the only ones that satisfy the above condition are $\{ 1,4,7,13,31\}$. I then tried to prove that it doesn't work for $n\geq 31$ with induction for a bit before coming here. The calendar usually has the day of the month as the answer, so the answer should be 31, but I wasn't able to prove this.
Also, for all $n\geq 31$, at least up to $200,000$, the remainder on division of $n^3+89$ by $n+5$ is always $n-31$, if that is useful. Thanks for any help or tips!