Fermat pseudoprimes
A Fermat pseudoprime is a composite number that passes a specific test for primality based on Fermat's Little Theorem. According to this theorem, if n is a prime number and a is an integer not divisible by n , then a^(n-1) \equiv 1 \mod n . A pseudoprime behaves like a prime in this context, even though it is not.
These numbers can mislead primality tests, making them appear prime when they are not. For example, if n is a Fermat pseudoprime to base a , it satisfies the theorem's condition, but n has factors other than 1 and itself.