Korselt's criterion states that, for an integer ,
For composite , the left-hand condition is equivalent to
being a Carmichael number,
so these solutions are precisely the Carmichael
numbers (Korselt 1899).
To prove sufficiency, consider each prime divisor of
. If
, then
. Otherwise, Fermat's
little theorem and
give
, so again
. The squarefree condition
then combines these divisibilities to give
.
Conversely, suppose
for every integer
. If
, the Chinese remainder
theorem gives an
that is congruent to
modulo
and to 0 modulo the largest divisor
of
relatively prime to
. Then
, contradicting
, so
is squarefree. For a prime divisor
of
, use the Chinese remainder
theorem to choose
congruent to a primitive
root modulo
and to 1 modulo
.
The number
is relatively prime to
, and
. Since
has multiplicative order
modulo
, it follows that
.