Fermat Pseudoprimes and Carmichael Numbers

Before this, knowFermat's Little Theorem

Read · 1 min

Introduction to Carmichael Numbers

When you first encountered Fermat's little theorem, you must have pondered if the reverse is true. That is, if an≡a(modn)a^n\equiv a\pmod n for all integers aa, then nn is prime or not. If you see some examples by hand, you may convince yourself that nn must be a prime in order to hold the condition true. Unfortunately, that is not the case. There are infinitely such nn, which we will call Carmichael number. Here, by a⊥na\bot n, we mean gcd⁡(a,b)=1\gcd(a,b)=1.

If nn is a composite integer so that an≡a(modn)a^n\equiv a\pmod n, then nn is a pseudoprime base aa. If an≡a(modn)a^n\equiv a\pmod n for all integer aa i.e. nn is a pseudoprime base aa for all integer aa, then nn is a Carmichael number. For a⊥na\bot n one has \begin{align*} a^{n-1} & \equiv1\pmod n \end{align*} The following criterion gives us a way to determine if a number is Carmichael or not.

Korselt's Criterion A composite integer nn is a Carmichael number if and only if nn is squarefree and for any prime p∣np|n, we have p−1∣n−1p-1|n-1.

Let's prove this now. We will consider n>1n>1.

For the sake of contradiction, assume p2p^2 divides nn if p∣np|n. Then for all aa, p2∣an−ap^2|a^n-a too. Choose a=pa=p and we have p2∣pn−pp^2|p^n-p or p2∣pp^2|p, which is impossible. So, nn is squarefree.

For the second part, we can assume without loss of generality that p∤ap\nmid a. Note that, from Fermat's Little Theorem, ap−1≡1(modp)a^{p-1}\equiv1\pmod p We also have an−1≡1(modp)a^{n-1}\equiv1\pmod p. Since this has to be true for all a⊥pa\bot p, we are free to choose aa as long as a⊥pa\bot p. Let's choose a primitive root gg of pp i.e. . Then \begin{align*} g^{p-1} & \equiv1\pmod p\newline g^{n-1} & \equiv1\pmod p \end{align*} Since , we must have p−1∣n−1p-1|n-1.

Thus, the criterion is proved.

Caution: though we stated that there are infinitely many Carmichael numbers, it is not trivial. In fact, it took a long time for mathematicians to prove this fact. Alford, Granville and Pomerance proved it first in 19941994 (Annals of Mathematics, 140(1994)140(1994), 703−722703-722).

Read · 1 min

Prove that 561561 is a Carmichael number. Is there a smaller such number?

Read · 1 min

Prove that 341341 is a pseudoprime base 22.

Type a concept, like “slope” or “photosynthesis”.

↑ ↓ to choose · Enter to openSearch explanations and problems