<s>[INST] Show that if $gcd(n,42) = 1$ then $n^6 \equiv 1 \pmod {42} $ Show that if $gcd(n,42) = 1$ then $n^6 \equiv 1 \pmod {42} $
I notice that $a \equiv 1 \pmod{2}$, $a^2\equiv 1 \pmod{3}$, $a^6 \equiv 1 \pmod{7}$
In the first case $a=-1,1,-3,3$ In order for the second condition to hold $a=-1,1$ which would imply then that $a^6 \equiv 1 \pmod{2}$ and $a^6 \equiv 1 \pmod{3}$, and $a^6\equiv 1 \pmod{7}$ so by the chineese remainder theorem you can conclude that $a^6 \equiv 1\pmod{42}$
 [/INST] Fermat's little theorem gives immediately $n^6\equiv 1\mod 7$
Since $n$ is odd, we have $n^6\equiv 1\mod 2$
Since $n$ is not divisble by $3$, we have $n^6\equiv 1\mod 3$ because of $n^2\equiv 1\mod 3$
The chinese remainder theorem gives $n^6\equiv 1\mod 42$
</s>