[Math] Show that the cube of any integer is congruent to $0$ or $\pm 1 \pmod 7 $

congruencesmodular arithmetic

For any integer, $n$, show that $n^3 \equiv 0$ or $\pm 1(\mod 7)$. Use theory of congruences

So I thought about a couple of ways to go with this. I thought about showing $7|n^3$ or $7|n^3\pm1$ to be true by letting $n=7k, 7k\pm1, 7k\pm2, 7k\pm3$ and proving it that way but that seemed like a long route. Also, the problem asks to use theory of congruences and I'm not sure if this approach really uses that.

Is there a way to use the fact that $a^n \equiv b^n (\mod m)$? I tried following this logic, but I got stuck trying to imply that $n \equiv 0$ or $\pm 1(\mod 7)$ by removing the cube root.

Any help is appreciated!

Best Answer

Fermat's theorem tells us that $n^7 \equiv n \bmod 7$ and so $7$ divides $n^7-n=n(n^3-1)(n^3+1)$.

Since $7$ is prime, $7$ must divide one of the factors:

  • If $7$ divides $n$, then $7$ divides $n^3$, and so $n^3 \equiv 0 \bmod 7$.
  • If $7$ divides $n^3- 1$, then $n^3 \equiv 1 \bmod 7$.
  • If $7$ divides $n^3+ 1$, then $n^3 \equiv -1 \bmod 7$.
Related Question