A divisibility question involving Fermat's theorem use How I am supposed to solve questions like 
if $\gcd (a,42) =1$ and $168= 3\times 7\times8$ then show that $168$ divides $a^6-1$.

From $(a,42) =1$ and using Fermat's little theorem :


*

*$(a,7) =1$ so that $\ a^{7-1}\equiv 1\pmod{7}\quad$ ($7$ divides $a^6-1$) 

*$(a,3) =1$ so that $\ a^{3-1}\equiv 1\pmod{3}\quad$ ($3|(a^2-1)$ and $(a^2-1)|(a^6-1)$)

*$(a,2) =1$ so that $a$ is odd but for odd $a$ we get $\ (\pm 1)^2\equiv (\pm 3)^2\equiv 1\pmod{8}$ and $a^6\equiv 1\pmod{8}$ (i.e. 8 divides $a^6-1$).


We conclude that $8\cdot 3\cdot 7$ divides $a^6-1$.
