Carmichael number Created 2026-09-24 Updated 2026-10-18
A Carmichael number is a composite number for which
Every unit modulo satisfies the same modular congruence supplied by Fermat's little theorem for a prime number. The name refers to Robert Daniel Carmichael. The coprime qualification is essential: a nonunit can expose a prime factor through a greatest common divisor calculation. A Carmichael number is therefore a Fermat pseudoprime to every coprime base, rather than to every nonzero residue class.[ref]
For example,
The factors are distinct prime numbers. Their predecessor numbers all divide , so Korselt criterion applies. More explicitly, for any integer coprime to , Fermat's little theorem gives
The Chinese remainder theorem combines these into . This proves all coprime bases pass from three short divisibility checks, rather than from a long table of sampled bases.
Figure 1.
Three prime factors certify that every unit passes the Fermat congruence modulo 561
. Original arithmetic certificate for . Exponents divide with quotients ; the Chinese remainder theorem combines the three prime-modulus conclusions. Details.
Equivalently, a composite is a Carmichael number exactly when for every integer , including nonunits. The equivalence follows from Korselt criterion: modulo each prime factor, either is zero or its nonzero power returns to one, and squarefreeness combines those congruences. This does not say a nonunit satisfies . For instance gives , while ; the greatest common divisor already supplies the factor three.[ref]
The Carmichael function supplies another compact description: a composite is Carmichael exactly when . For , and . In contrast, Euler's totient function gives , which does not divide . The least common return exponent, rather than the number of units, controls this test.
The obstruction is useful to know when interpreting a Fermat primality test: even checking every coprime base cannot certify primality. The passing-base fraction for the Fermat test makes this failure quantitative. Stronger primality tests require additional structure, such as the squaring conditions in a Miller-Rabin primality test.
The historical record predates the name. Václav Šimerka's 1885 paper lists on printed page 224, together with factorizations. This is an early published list of examples, independently of their later name.[ref]
Euler's theorem Created 2026-10-03 Updated 2026-11-05
For an integer modulus and an integer with greatest common divisor , Euler's theorem, also called the Fermat-Euler theorem, states
Here Euler's totient function counts the units in the unit group . These congruence classes have modular multiplicative inverses, equivalently their representatives are coprime to . The guaranteed return to one permits exponent reduction for units.[ref]
For a prime number , , recovering Fermat's little theorem in the form when . Multiplying by and separately handling gives for every integer . For a composite number used as the integer modulus, a nonzero congruence class can be a nonunit.
Modulo twelve, the units have representatives , so Euler's totient function gives . Multiplication by five produces
Thus this permutation has two permutation cycles, each of length two. In particular , and the guaranteed return follows. The number of units need not be the length of one permutation cycle. Modulo fifteen, multiplication by seven similarly gives the two permutation cycles and , covering all eight units. The powers of seven follow the permutation cycle containing one; the other permutation cycle shows that these powers do not visit every unit.
Figure 1.
Two unit permutations: multiplication by five modulo twelve and by seven modulo fifteen
. Every arrow multiplies by the indicated unit and reduces modulo the indicated integer modulus. The permutation cycles exhaust each reduced residue system. The permutation cycle containing one records the powers of the multiplier; its length is the multiplier's multiplicative order, which can be smaller than Euler's totient function. Details.
There is a stronger obstruction for a nonunit than just an occasional failed calculation. If a positive integer divides both and , then for every , so cannot be congruent to one modulo . For example, and , rather than one. Such a base has no multiplicative order modulo that integer modulus.[ref]
For a unit modulo n and a nonnegative integer , division with remainder writes with . Euler's theorem then gives
This replaces a potentially enormous exponent by a small remainder. The exponent itself is reduced modulo Euler's totient function, while the powers are reduced modulo : these are different integer moduli.
For a worked modulo-fifteen calculation, seven is coprime to fifteen and . Therefore
Use exponentiation by squaring on the remaining exponent , reducing after each multiplication:
Thus . Modular exponentiation supplies the computation; Euler's theorem supplies the optional shortening of its exponent. Exponentiation by squaring also works for nonunit bases, without using this shortening.
The guaranteed exponent is a common return exponent and an upper bound on the shortest period; it need not be that period. The multiplicative order is the least positive return exponent for the chosen unit. The Carmichael function is the least positive return exponent that works for every unit. Their precise relation is
Either smaller return exponent can replace in exponent reduction for units. Modulo fifteen, , so gives immediately. For base four the multiplicative order is only two, smaller even than . A return at exponent eight alone does not prove that the multiplicative order is eight.[ref]
Figure 1.
Actual power periods, Carmichael function exponents and Euler return exponents
. Each row lists powers from exponent zero through eight. Highlighted first returns identify multiplicative orders; the accompanying labels distinguish a chosen base's shortest period, the common exponent for all units, and Euler's totient function. Powers of the nonunit three modulo fifteen repeat after an initial term but never return to one at a positive exponent. The final calculation compares reduction of modulo eight and modulo four. Details.
If the reduced exponent is zero, the rule gives , and still requires a unit. Applying it to the nonunit three would falsely predict ; the actual residue is six. For negative exponents, first interpret the power using a modular multiplicative inverse, as in modular exponentiation.
Fermat witness 2026-10-14
A Fermat witness for an integer is a nonzero residue class represented by for which . It proves that is a composite number by Fermat's little theorem. Here the definition includes nonunits; some conventions restrict Fermat witnesses to bases coprime to . The Fermat primality test can first compute the greatest common divisor: if , it already has a proper factor. A zero residue class is excluded. [ref]
In a principal ideal domain, every nonzero prime ideal is maximal. Indeed, write it as with . If , then . Primality gives , hence , or , say , in which case cancellation gives and .
Thus every prime chain has length at most one. If the principal ideal domain is not a field, choose a nonzero nonunit and a maximal ideal . Then is a prime chain of length one, so the Krull dimension is one. A field instead has Krull dimension zero.
Choose a reduced residue system . For a unit modulo n , the bijection on the unit group has inverse . Comparing products before and after this permutation gives
The product is a unit; its modular inverse cancels it, proving Euler's theorem. Merely being nonzero would not justify cancellation.[ref]
In the modulo-twelve example, . The permuted representatives have the same product, while the unreduced products equal . Equating these products modulo twelve exposes the fourth power without calculating it directly. Using all nonzero congruence classes instead would include nonunits, whose product need not permit cancellation.
Nonunit Created 2026-10-03 Updated 2026-11-05
A nonunit is an element of a ring with no two-sided multiplicative inverse in that ring. For example, is a nonunit in the integers, even though multiplication by obeys the cancellation law. Thus being a nonunit does not imply being a zero divisor.
The set of nonunits need not be an ideal. In , both and are nonunits, but their sum is a unit. In a commutative local ring, by contrast, the nonunits form its unique maximal ideal.
Among the units modulo , the passing residue classes form the kernel of a group homomorphism . If each trial samples independently and uniformly from those units, with replacement, the probability that trials all pass is . This statement assumes that sampling rule; it does not describe arbitrary or dependent choices of bases.
For , the Chinese remainder theorem identifies the unit group with cyclic groups of orders and . The number of solutions of is , among units. Thus . The Carmichael numbers and have passing fractions and , so their conditional false-pass probability remains one regardless of the number of independent trials.
Figure 1.
All nonzero bases: coprime passes, coprime witnesses and factor-revealing nonunits
. Exact enumeration for four stipulated moduli. A greatest common divisor check separates nonunits before modular exponentiation. Counts are finite arithmetic results, not measured rates or a universal bound for a primality test. Details.
The Fermat test example uses selected bases; this diagram exhausts the specified finite base sets. Both make the same logical distinction: an exponent witness can prove compositeness, whereas a passing result needs further justification before it can support a claim of primality.
Suppose, for a contradiction, that the monic irreducible polynomials in the polynomial ring form a finite list . The list is nonempty because itself is monic and irreducible. Put
This has positive degree, so it is a nonzero nonunit. Every such polynomial over a field has an irreducible polynomial as a factor: repeatedly factor a reducible polynomial, with the positive degrees strictly decreasing until an irreducible factor is reached. Dividing that factor by its leading coefficient makes it monic; call it .
By the assumed completeness of the list, for some . But then divides both and , hence their difference . A positive-degree polynomial cannot divide . This contradiction proves there are infinitely many monic irreducible polynomials over every field. This is the polynomial version of Euclid's theorem; it does not require the field itself to be infinite.
In this localization of a ring, a nonzero fraction with odd is a unit exactly when is odd: its reciprocal then has odd denominator; if is even, an inverse would equate an even integer with an odd one after clearing denominators. Consequently every nonzero element has a unique form
Here is the exponent of in the numerator of the reduced fraction, its nonnegative 2-adic valuation.
Every nonzero ideal has the form by part (c). Write the nonzero integer with odd; since is a unit, . Hence the nonzero proper ideals are exactly
The zero ideal and complete the full list. These ideals are distinct: does not belong to , since .
The reduction map is a well-defined surjective ring homomorphism with kernel of a ring homomorphism ; odd denominators reduce to . Thus is a field, so is a prime ideal and is a prime element. Every nonzero nonunit is associated to with . If , the factorization is into two nonunits, so it is not an irreducible element and therefore not a prime element. We conclude
The failed step in the argument of part (b) is the guarantee that the product plus one is a nonunit and hence has an irreducible factor. Here every prime element is an even fraction, so a product of prime elements plus is an odd fraction, therefore a unit. Already has no prime divisor in this ring. In , positive degree prevented that failure.
The structure theorem for finitely generated modules over a principal ideal domain applies to a Euclidean domain because every Euclidean domain is a principal ideal domain. In invariant-factor form, every finitely generated module has a decomposition
where , and each is a nonzero nonunit. The rank of a module is unique and the invariant factors of a finitely generated module are unique up to multiplication by units. The zero module is allowed by taking .
Every abelian group is a module over , and a finite abelian group is finitely generated. Since is a Euclidean domain, the theorem applies. A nonzero free module summand would be infinite, so a finite group has . Choosing positive integer representatives gives the finite abelian classification
The ordered integers are uniquely determined. Splitting each into prime powers using the Chinese remainder theorem gives the equivalent elementary-divisor form as a direct sum of cyclic prime-power groups.
The Krull dimension of a commutative ring is
The length of a prime chain counts strict inclusions, rather than the number of prime ideals.
Let be a principal ideal domain that is not a field. We first show that every nonzero prime ideal is a maximal ideal. Write such a prime ideal as with , and suppose . Then for some . Since , either , in which case , or . In the second case for some , and gives by multiplicative cancellation in an integral domain. Thus . This proves maximality.
Since is an integral domain, is a prime ideal, and every other prime ideal is maximal. Consequently every prime chain has length at most one. For the opposite inequality, choose a nonzero nonunit , which exists because is not a field. The proper principal ideal is contained in a maximal ideal ; existence follows from Zorn's lemma applied to the proper ideals containing . A maximal ideal is a prime ideal, since its quotient ring is a field. Therefore is a prime chain of length one. Thus the Krull dimension of a principal ideal domain that is not a field is
The algebraic norm on is and satisfies multiplicativity of the algebraic norm. The calculation in part (a) therefore gives all elements of norm :
If one of these factored into two nonunits, multiplicativity would force both factors to have norm . But the Diophantine equation has no solution. Hence all six displayed elements are irreducible. This is a standard example in which an irreducible element need not have prime norm.
We prove the stated Eisenstein criterion directly. Assume . Suppose in the polynomial ring . Since the principal ideal domain is an integral domain, polynomial degree is additive under polynomial multiplication, and the product of the leading coefficients of is the leading coefficient of . These two coefficients are therefore units. Multiplying and by inverse units, without changing their product, makes both factors monic polynomials.
If either factor is a constant polynomial, that factor is now , so the original factor was a unit. It remains to rule out and .
The prime element generates a maximal ideal in the principal ideal domain . Indeed, if , then , and the irreducible element property of forces either or . Consequently is a field. Apply reduction modulo an ideal to every coefficient. The monic polynomial factors retain their polynomial degrees, and the hypotheses give
The polynomial ring over a field is a unique factorization domain, and is an irreducible polynomial. Thus its only monic polynomial divisors in are powers of . Hence and . Both have zero constant term, so and . This gives , a contradiction.
The monic polynomial has positive polynomial degree, so it is a nonzero nonunit. Every factorization therefore has a unit factor, proving
No such property exists. The ring isomorphism in part (b)(ii) identifies quotient rings by elements having different irreducible element behaviour.
The element is an irreducible element of . It is nonzero and a nonunit. Every nonzero nonunit of has polynomial degree at least : the only possible polynomials of smaller polynomial degree are constant polynomials, and every nonzero constant polynomial is a unit. If with both nonunits, additivity of polynomial degree in the integral domain would give
which is impossible. Thus one factor must be a unit.
In , however, is a product of two nonunits, so is not an irreducible element. If a ring isomorphism invariant characterized irreducible elements by the indicated quotient ring, the irreducible element would imply that has . Its isomorphic quotient ring would then have , incorrectly making an irreducible element.
Consequently,
The required property is
For a nonzero element of an integral domain , this follows from
Indeed, in the quotient ring exactly when . The prime element condition says this forces or , exactly the absence of zero divisors in the quotient ring. The nonunit condition makes the quotient ring nonzero. Being an integral domain is preserved by every ring isomorphism.
With the usual definition of a prime element, is understood. The prime ideal formulation works for every ideal of any commutative ring, including the zero ideal; it avoids this convention about elements.
Polynomial division Created 2026-09-24 Updated 2026-10-18
Polynomial division separates a polynomial into a multiple of a chosen divisor and a smaller polynomial remainder. Given over a field , with , there are unique polynomials satisfying
Here is the polynomial quotient. The bound concerns polynomial degree, rather than the sizes of the coefficients.[ref]
For an original example over the rational numbers, take
Polynomial long division first cancels by subtracting :
Subtracting one more copy of cancels :
Thus
The final polynomial remainder has polynomial degree one, below the divisor's polynomial degree two. Multiplying out the last identity checks every coefficient, including the constant term .
Figure 1.
Polynomial long division cancels the cubic and quadratic terms in two steps, recording and
. Details.
The polynomial degree bound makes this decomposition useful: it replaces a potentially long polynomial with a short polynomial remainder whenever multiples of can be discarded. At any root of a polynomial of , those multiples vanish under polynomial evaluation. Repeated polynomial division also drives the Euclidean algorithm for finding a greatest common divisor of polynomials.
The coefficient setting matters. Over a commutative ring, the same existence and uniqueness hold when the divisor's leading coefficient is a unit in a ring. A monic polynomial therefore works over the integers, even though they do not form a field; monic polynomial division over a ring explains why zero divisors cause no difficulty in that case.[ref]
A nonzero divisor alone is insufficient over the integers. Dividing by with an integer polynomial quotient and a constant polynomial remainder would require for an integer , which is impossible. Over the rational numbers the division instead gives
The obstruction is the nonunit leading coefficient . This example separates existence from uniqueness: over an integral domain, the polynomial degree argument still makes any admissible pair unique, if it exists.
Unit in a ring Created 2026-09-24 Updated 2026-11-05
A unit in a unital ring is an element with a two-sided multiplicative inverse :
The ring is part of the condition. In the only units are and , whereas every nonzero rational number is a unit in . Modulo six, is a unit because , while is a nonunit.
In a nonzero ring, zero is never a unit, since . Every unit has multiplicative cancellation, but a cancellable element need not be a unit: can be cancelled in the integers, yet its reciprocal is not an integer. The units form the unit group of the ring.