<s>[INST] $a^{12} \equiv 1 \pmod{35}$,knowing that $(a,35)=1$ Prove that $\forall a \text{ with } (a,35)=1:$
$$a^{12} \equiv 1 \pmod{35}$$
$$35 \mid a^{12}-1 \Leftrightarrow 5 \cdot 7 \mid a^{12}-1 \overset{(5,7=1)}{ \Leftrightarrow} 5 \mid a^{12}-1 \text{ and } 7 \mid a^{12}-1$$
Therefore, $\displaystyle{ a^{12} \equiv 1 \pmod{35} \Leftrightarrow a^{12} \equiv 1 \pmod 5, a^{12} \equiv 1 \pmod 7}$
$$(a,35=1) \Rightarrow (a, 5 \cdot 7)=1 \overset{(5,7)=1}{\Rightarrow } (a,5)=1 \text{ and } (a,7)=1$$
According to Fermat's theorem:
$$a^4 \equiv 1 \pmod 5$$
$$a^{12} \equiv (a^4)^3 \equiv 1 \pmod 5$$
Also:
$$a^6 \equiv 1 \pmod 7$$
$$a^{12} \equiv (a^6)^2 \equiv 1 \pmod 7$$
So,we conclude that:
$$a^{12} \equiv 1 \pmod{35}$$
Could you tell me if it is right?
 [/INST] Hint : For $(a,5)=1$ only possibilities are : $a=5k+1;5k+2;5k+3;5k+4$
$(5k+1)^{12}\equiv 1\mod5$ case should be clear...
$(5k+2)^{12}\equiv 1\mod 5$ should be clear if you know what $2^{12}$ is... 
$(5k+3)^{12}\equiv 1\mod 5$ should be clear if you know what $3^{12}$ is... 
$(5k+4)^{12}\equiv 1\mod 5$ should be clear if you know what $4^{12}$ is... 
You may repeat this kind of strategy for case of $7$ and conclude what you wanted to...
</s>