Suppose $n\in \Bbb Z$.
How to prove that $n^6$ mod $7$ is equal to $1$ if $n$ is NOT a multiple of $7$ without using Fermat little theorem.
Suppose $n\in \Bbb Z$.
How to prove that $n^6$ mod $7$ is equal to $1$ if $n$ is NOT a multiple of $7$ without using Fermat little theorem.
All you have to do is check from $n=1$ to $n=[7/2]$...
$$1^6\equiv1\pmod7\\2^6\equiv1\pmod7\\3^6\equiv1\pmod7$$
That suffices to show since $4^6=(7-3)^6\equiv3^6$, and likewise for $n=5,6,7$.
This follows from the fact that
$$n^6\equiv(n\mod7)^6\pmod7$$
Simply calculating for $n\equiv \pm2,\pm 3\mod 7$.
Anyway $2^3\equiv 1\mod 7$, whence the result for $\pm2$, and $(\pm3)^2\equiv2\mod 7$, so this case comes down to the previous one.
Consider the following cases: