Definition:Fermat Pseudoprime

Definition
Let $q$ be a composite number such that $\exists n \in N: n^q \equiv n \pmod q$.

Then $q$ is a Fermat pseudoprime to base $n$.

Fermat Pseudoprimes to base $2$ (Poulet Numbers)
Fermat pseudoprimes to base $2$ are known as Poulet numbers:

Also see

 * Fermat's Little Theorem: if $p$ is a prime, then $\forall n \in \N: n^p \equiv n \pmod p$.

However, it is not always the case that if $\forall n \in \N: n^p \equiv n \pmod p$ then $p$ is prime.

Such counterexamples are not easy to find.


 * Definition:Carmichael Number: an even rarer composite number $q$ such that $\forall n \in \N, n \perp q: n^q \equiv n \pmod q$.