Definition:Carmichael Number

An odd integer $$n>0$$ is a Carmichael number iff:
 * $$n$$ is composite;
 * $$\forall a \in \Z: a \perp n: a^n \equiv a \left({\bmod\, n}\right)$$, or, equivalently, that $$a^{n-1} \equiv 1 \left({\bmod\, n}\right)$$.

That is, a Carmichael number is a composite number which satisfies $$a^n \equiv a \left({\bmod\, n}\right)$$ for all integers coprime to it.

A Carmichael number is also referred to as a pseudoprime (or Fermat liar), as it exhibits the same properties as a prime when Fermat's Little Theorem is applied.

The first Carmichael number was given by R.D. Carmichael in 1912.

Properties
The characterization of Carmichael Numbers was given by A. Korselt in what is known as Korselt's Theorem, which states the following:

An odd integer $$n>0$$ is a Carmichael number if and only if both of the following conditions hold for each prime factor of $$n$$:


 * $$p^2 \nmid n$$
 * $$(p-1) \mid (n-1)$$