TITLE: Why, given a natural number $n$, does $n^6$ always have the remainder of 1 when divided by 7?
QUESTION [7 upvotes]: I am trying to prove why a natural number $n$ (which is not a multiple of $7$) when taken to the power of six ($n^6$) and divided by 7 always have the remainder of 1? I am not supposed to use "Fermats little theorem", but I am given the hint that the only numbers I have to account for are $1, 2, 3, 4, 5, 6$.
I would very much appreciate if someone could explain this to me.
Thank you

REPLY [3 votes]: You can shrink the size of the numbers you need to deal with by noticing that
$$
n^6-1=(n^3-1)(n^3+1)=(n-1)(n+1)(n^2-n+1)(n^2+n+1) \, .
$$
So if any of those four factors are multiples of $7$, so too will be $n^6-1$.
Now,

$1-1=0 \times 7$
$2^2+2+1=1 \times 7$
$3^2-3+1=1 \times 7$
$4^2+4+1=3 \times 7$
$5^2-5+1=3 \times 7$
$6+1=1 \times 7$

so one of these factors is a multiple of $7$ for all $n \in \{1,2,3,4,5,6\}$.