Let $n\in\mathbb{N}$ with $n\ge 3$ and $a\in\mathbb{Z}$ such that $$a^{n-1}\equiv1\text{ mod } n\;\;\;\wedge\;\;\;a^{\frac{n-1}{p}}\not\equiv1\text{ mod }n\;\;\;\forall p\in\mathbb{P}:p\mid n-1$$ where $\mathbb{P}$ denotes the set of prime numbers $\Rightarrow$ $n\in\mathbb{P}$.
What does all that mean? Fermat's little theorem states, that if $p\in\mathbb{P}$, then it holds for all $a\in\mathbb{Z}$ with $p\nmid a$:$$a^{p-1}\equiv 1\text{ mod }p$$ It seem's like this has something in common with the statement above. However, we only know that the congruence is fulfilled for one specific $a$ and Fermat's little theorem doesn't help in this direction.
So, how would one argue?