Let $N =\overline{abc}$ be a three-digit integer with distinct digits $a$, $b$, and $c$. What is the largest possible integer $N$ such that, when $N$ is cubed, the resulting integer ends with the same three digits as $N$?
Here is what I did: I know that $N^3\equiv N \pmod{1000}.$ That means that $N^3-N\equiv 0 \pmod{1000}$ or $N(N-1)(N+1)\equiv0 \pmod{1000}.$ However, I don't know how to quickly find numbers that fit the properties without brute force. What do I do?
OK, I got it. So, based on my initial trial, I know that $N(N-1)(N+1)\equiv0 \pmod{1000}.$ Now there are two cases. Why? Because $N+1$ and $N-1$ must have the same parity, meaning that they must both be even or they must both be odd. Note that $1000=2^3\times5^3$. Using this, we can rule out the case where $N$ is even. Why? Because if $N$ is even, $N+1$ and $N-1$ must be odd. $N$ must be divisible by 2, 4, or 8, but the two odd numbers should be divisible by 5, an impossibility (Note that $500$ is both divisible by 125 and 4, but not, 8, and since the other two numbers are odd. This means that $N$ must be odd, and if $N$ should be maximized, it should be a factor of 125. Note that there is at least one multiple of 4 next to a number ending in 25 or 75, so this assumption works. This gives us the largest three digit multiple of 125, $\boxed{875}$.