<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] Yes we can tell. This is because we have $a^{12} \equiv 1 \pmod 5 \iff 5|(a^{12}-1).$ Similarly $a^{12} \equiv 1 \pmod 7 \iff 7|(a^{12}-1)$. Since ${\rm gcd}(5,7)=1$, we have $5\cdot 7 | (a^{12}-1)$, i.e., $a^{12} \equiv 1 \pmod {35}$.
</s>