ArticleslgStudy

mathematics

Carmichael number

Carmichael number is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Carmichael number rather than just read about it. In short: In number theory, a Carmichael number is a composite number ⁠n⁠ which in modular arithmetic satisfies the congruence relation: bn≡b(modn) for all integers ⁠b⁠. The relation may also be expressed in the form: bn−1≡1(modn) for all integers b that are relatively prime to ⁠n⁠.

Carmichael number — main illustration
Carmichael number — illustration

Key takeaways

  • Carmichael number belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Carmichael number to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Carmichael number from memory before moving on to harder problems.

Reference excerpt

In number theory, a Carmichael number is a composite number ⁠n⁠ which in modular arithmetic satisfies the congruence relation:

bn≡b(modn) for all integers ⁠b⁠. The relation may also be expressed in the form:

bn−1≡1(modn) for all integers b that are relatively prime to ⁠n⁠. They are infinite in number.

They constitute the comparatively rare instances where the strict converse of Fermat's Little Theorem does not hold. This fact precludes the use of that theorem as an absolute test of primality. The Carmichael numbers form the subset K1 of the Knödel numbers. The Carmichael numbers were named after the American mathematician Robert Carmichael by Nicolaas Beeger, in 1950. Øystein Ore had referred to them in 1948 as numbers with the "Fermat property", or "F numbers" for short. The first few Carmichael numbers are:

561, 1105, 1729, 2465, 2821, 6601, 8911, 10585, 15841, 29341, 41041, 46657, 52633, 62745, 63973, 75361, 101101, 115921, 126217, 162401, 172081, 188461, 252601, 278545, 294409, 314821 ... (sequence A002997 in the OEIS)

Overview Fermat's little theorem states that if p is a prime number, then for any integer ⁠b⁠, the number bp−b is an integer multiple of ⁠p⁠. Carmichael numbers are composite numbers which have the same property. Carmichael numbers are also called Fermat pseudoprimes or absolute Fermat pseudoprimes. A Carmichael number will pass a Fermat primality test to every base b relatively prime to the number, even though it is not actually prime. This makes tests based on Fermat's Little Theorem less effective than strong probable prime tests such as the Baillie–PSW primality test and the Miller–Rabin primality test. However, no Carmichael number is either an Euler–Jacobi pseudoprime or a strong pseudoprime to every base relatively prime to it so, in theory, either an Euler or a strong probable prime test could prove that a Carmichael number is, in fact, composite. Arnault gives a 397-digit Carmichael number N that is a strong pseudoprime to all prime bases less than 307:

N=p⋅(313(p−1)+1)⋅(353(p−1)+1) where

p= 2​‍9674495668​‍6855105501​‍5417464290​‍5332730771​‍9917998530​‍4335099507​‍5531276838​‍7531717701​‍9959423859​‍6428121188‍0336647542​‍1834556249​‍3168782883 is a 131-digit prime. p is the smallest prime factor of ⁠N⁠, so this Carmichael number is also a (not necessarily strong) pseudoprime to all bases less than ⁠p⁠. As numbers become larger, Carmichael numbers become increasingly rare. For example, there are 20138200 Carmichael numbers between 1 and 1021 (approximately one in 50 trillion (5×1013) numbers).

Korselt's criterion An alternative and equivalent definition of Carmichael numbers is given by Korselt's criterion.

Theorem (A. Korselt 1899): A positive composite integer n is a Carmichael number if and only if n is square-free, and for all prime divisors p of ⁠n⁠, it is true that ⁠p−1∣n−1⁠. It follows from this theorem that all Carmichael numbers are odd, since any even composite number that is square-free (and hence has only one prime factor of two) will have at least one odd prime factor, and thus p−1∣n−1 results in an even dividing an odd, a contradiction. (The oddness of Carmichael numbers also follows from the fact that −1 is a Fermat witness for any even composite number.) From the criterion it also follows that Carmichael numbers are cyclic. Additionally, it follows that there are no Carmichael numbers with exactly two prime divisors.

Discovery The first seven Carmichael numbers, from 561 to 8911, were all found by the Czech mathematician Václav Šimerka in 1885 (thus preceding not just Carmichael but also Korselt, although Šimerka did not find anything like Korselt's criterion). His work, published in Czech scientific journal Časopis pro pěstování matematiky a fysiky, however, remained unnoticed. Korselt was the first who observed the basic properties of Carmichael numbers, but he did not give any examples. That 561 is a Carmichael number can be seen with Korselt's criterion. The first seven Carmichael numbers are (sequence A002997 in the OEIS):

561=3⋅11⋅17(2∣ 560;10∣ 560;16∣ 560) 1105=5⋅13⋅17(4∣1104;12∣1104;16∣1104) 1729=7⋅13⋅19(6∣1728;12∣1728;18∣1728) 2465=5⋅17⋅29(4∣2464;16∣2464;28∣2464) 2821=7⋅13⋅31(6∣2820;12∣2820;30∣2820) 6601=7⋅23⋅41(6∣6600;22∣6600;40∣6600) 8911=7⋅19⋅67(6∣8910;18∣8910;66∣8910). In 1910, Carmichael himself also published the smallest such number, 561, and the numbers were later named after him. Jack Chernick proved a theorem in 1939 which can be used to construct a subset of Carmichael numbers. The number (6k+1)(12k+1)(18k+1) is a Carmichael number if its three factors are all prime. Whether this formula produces an infinite quantity of Carmichael numbers is an open question (though it is implied by Dickson's conjecture). Paul Erdős heuristically argued there should be infinitely many Carmichael numbers. In 1994, W. R. (Red) Alford, Andrew Granville and Carl Pomerance used a bound on Olson's constant to show that there really do exist infinitely many Carmichael numbers. Specifically, they showed that for sufficiently large ⁠n⁠, there are at least n2/7 Carmichael numbers less than ⁠n⁠. Thomas Wright proved that if a and m are relatively prime, then there are infinitely many Carmichael numbers in the arithmetic progression ⁠a+k⋅m⁠, where ⁠k=1,2,…⁠. In 2025, it was shown that any arithmetic progression contains either infinitely many Carmichael numbers or none at all. It is also known that for any sufficiently large N, there are infinitely many Carmichael numbers with exactly N prime divisors. In 1992, Löh and Niebuhr found some very large Carmichael numbers, including one with 1101518 factors and over 16 million digits. This has been improved to 10333229505 prime factors and 295486761787 digits, so the largest known Carmichael number is much greater than the largest known prime.

Properties

Factorizations Carmichael numbers have at least three prime factors. The first Carmichael numbers with k=3,4,5,… prime factors are (sequence A006931 in the OEIS):

The first Carmichael numbers with 4 prime factors are (sequence A074379 in the OEIS):

The second Carmichael number (1105) can be expressed as the sum of two squares in more ways than any smaller number. The third Carmichael number (1729) is the Hardy-Ramanujan Number: the smallest number that can be expressed as the sum of two cubes (of positive numbers) in two different ways.

… excerpt ends here. Continue reading the full article.

Illustrations

Carmichael number: Robert Daniel Carmichael
Robert Daniel Carmichael
Carmichael number: Václav Šimerka listed the first seven Carmichael numbers
Václav Šimerka listed the first seven Carmichael numbers

Worked examples

Example 1 — a first encounter with Carmichael number

Start with the simplest possible case. Write down what Carmichael number claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Carmichael number before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Carmichael number ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Carmichael number

In research
Carmichael number appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Carmichael number in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Carmichael number is common in secondary-school and first-year university syllabi. It links to neighbouring topics Integer sequences, Modular arithmetic, Pseudoprimes, so understanding it makes those chapters shorter.
In everyday life
Look for Carmichael number outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Carmichael number” →

How to study Carmichael number in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Carmichael number means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Carmichael number out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Carmichael number in simple terms?

In number theory, a Carmichael number is a composite number ⁠n⁠ which in modular arithmetic satisfies the congruence relation: bn≡b(modn) for all integers ⁠b⁠. The relation may also be expressed in the form: bn−1≡1(modn) for all integers b that are relatively prime to ⁠n⁠.

Why does Carmichael number matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Carmichael number?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Carmichael number.

Tags

  • Integer sequences
  • Modular arithmetic
  • Pseudoprimes

Keep exploring