The Question:
Let $n=(6t+1)(12t+1)(18t+1)$, where $t\in \Bbb Z$ and $6t+1$, $12t+1$, $18t+1$ are prime, and $(a,n)=1$.
Show that $a^{n-1} \equiv 1\pmod n$.
My Thoughts:
This blatantly looks like Fermat's Little Theorem, but I can't seem to find a way to adapt the proof of it for this question.
In particular, the proof of FLT fails in the last step in this case when you divide by $(n-1)!$:
$$a^{n-1}(n-1)! \equiv (n-1)! \pmod n \implies a^{p-1} \equiv 1 \pmod n$$
is a false statement because $(n-1)!$ is in fact a multiple of $n$.
Any hints?