User Rating 0.0
Total Usage 0 times
Presets:
Searching...
# Carmichael Number Prime Factorization Digits
Is this tool helpful?

Your feedback helps us improve.

About

Carmichael numbers are composite integers n that satisfy an1 1 (mod n) for every integer a coprime to n. They are the absolute Fermat pseudoprimes and represent a direct threat to any primality test relying solely on Fermat's little theorem. The smallest is 561 = 3 × 11 × 17, discovered by Robert Carmichael in 1910. Alford, Granville, and Pomerance proved in 1994 that infinitely many exist. Their density up to x is approximately x27, making them sparse but never absent.

This generator applies Korselt's criterion: n is Carmichael if and only if n is square-free and for every prime factor p of n, (p 1) divides (n 1). This algebraic test avoids the exponential cost of checking all coprime bases. Note: computation time grows substantially beyond 108 due to the factorization step required for each odd composite candidate.

carmichael numbers pseudoprimes number theory korselt criterion fermat pseudoprime number generator math tool

Formulas

A composite integer n is a Carmichael number if it passes the Fermat primality test for all bases coprime to it. The direct definition states:

an 1 1 (mod n)   for all a with gcd(a, n) = 1

Testing every base is computationally infeasible. Instead, this generator uses Korselt's criterion (1899), which provides an equivalent algebraic characterization:

n is Carmichael n is square-free for every prime p | n, (p 1) | (n 1)

The algorithm proceeds in three stages for each candidate n:

1. Factorize n via trial division up to n
2. Check square-free: all prime exponents = 1
3. Check divisibility: (n 1) mod (pi 1) = 0 for all i

Where n is the candidate composite number, p represents each distinct prime factor of n, and the notation (p 1) | (n 1) means "p 1 divides n 1". Candidates are restricted to odd numbers with at least 3 prime factors, since all Carmichael numbers are odd and have 3 prime factors.

Reference Data

#Carmichael NumberPrime FactorizationNumber of FactorsDigits
15613 × 11 × 1733
211055 × 13 × 1734
317297 × 13 × 1934
424655 × 17 × 2934
528217 × 13 × 3134
666017 × 23 × 4134
789117 × 19 × 6734
8105855 × 29 × 7335
9158417 × 31 × 7335
102934113 × 37 × 6135
11410417 × 11 × 13 × 4145
124665713 × 37 × 9735
13526337 × 73 × 10335
14627453 × 5 × 47 × 8945
15639737 × 13 × 19 × 3745
167536111 × 13 × 17 × 3145
171011017 × 11 × 13 × 10146
1811592113 × 37 × 24136
191262177 × 13 × 19 × 7346
2016240117 × 41 × 23336
211720817 × 13 × 31 × 6146
221884617 × 13 × 19 × 10946
2325260141 × 61 × 10136
242785455 × 17 × 29 × 11346
2529440937 × 73 × 10936

Frequently Asked Questions

Korselt's criterion requires n to be square-free and composite, with (p 1) | (n 1) for every prime factor p. If n = p × q (two factors), then (p 1) must divide pq 1, which simplifies to (p 1) | (q 1) and symmetrically (q 1) | (p 1). This forces p = q, violating the square-free condition. Therefore the minimum is 3 distinct prime factors.
Each odd composite candidate n requires trial division up to n, giving per-candidate cost of O(n). Since roughly n2 odd candidates exist below n, total cost is approximately O(n32). Searching up to 106 completes in under a second. Reaching 108 may take several seconds. The generator runs in a Web Worker to keep the interface responsive.
Yes. If n were even, then 2 would be a prime factor, requiring (2 1) = 1 to divide (n 1), which is trivially true. However, Fermat's theorem applied to base a = n 1 yields (n 1)n 1 1 (mod n). For even n, the left side is 1 (since n 1 is odd, so (1)odd = 1), requiring 1 1 (mod n), meaning n | 2, so n = 1 or 2. Neither is composite with 3 factors.
The Carmichael function λ(n) gives the smallest positive integer m such that am 1 (mod n) for all a coprime to n. A Carmichael number satisfies λ(n) | (n 1). For square-free n = p1p2pk, λ(n) = lcm(p1 1, …, pk 1). So Korselt's divisibility condition is exactly the statement that λ(n) divides n 1.
No. The Miller-Rabin test is strictly stronger than the Fermat test. It decomposes n 1 = 2s × d and checks intermediate square roots. A Carmichael number will always be detected as composite by at least 75% of randomly chosen bases in Miller-Rabin. With k independent rounds, the false positive probability is at most 4k. Deterministic variants using specific base sets can conclusively identify all composites below 3.317 × 1024.
Higher-order Carmichael numbers generalize the concept to polynomial rings. A k-th order Carmichael number n satisfies (a + 1)n an + 1 (mod n) in a degree-k extension. Order-1 Carmichael numbers are the classical ones. Higher orders are significantly rarer. This generator handles only the classical (order-1) case.