Determine the largest integer $n$ which has at most three digits and equals the remainder when $n^2$ is divided by $1000$.
I've determined that the last digit can only be 1, 5, or 6, but if I try to continue, I meet some problems with $n^2$.
Determine the largest integer $n$ which has at most three digits and equals the remainder when $n^2$ is divided by $1000$.
I've determined that the last digit can only be 1, 5, or 6, but if I try to continue, I meet some problems with $n^2$.
You're looking for $n$ such that $1000$ divides $n^2-n=n(n-1)$.
That means $8$ divides $n(n-1)$, and $125$ divides $n(n-1)$.
That means $8$ divides $n$ or $n-1$, and $125$ divides $n$ or $n-1$.
There aren't many numbers $n$ of at most three digits such that $125$ divides $n$ or $n-1$.
Look for ones such that also $8$ divides $n$ or $n-1$, and you'll find what you're looking for.