Batch modular inversion 2026-10-20
For invertible residue classes , all their modular inverses can be recovered with one inversion and a linear number of multiplications. Store prefix products , invert once, and sweep backward: if the current inverse is , then and . The same construction works in any commutative group.
Bounded exceptional primes for least quadratic nonresidues Created 2026-10-06 Updated 2026-10-14
If, for every , the smooth numbers up to with all prime factors at most have density at least , then for fixed there are only primes with . Apply the variance form of the large sieve to the indicator function of the -smooth numbers up to . For every exceptional prime, all these numbers are nonzero quadratic residues, so half its nonzero residue classes are empty. Their variance contribution is at least one third of the square of the total count. The large sieve bounds the sum of contributions by a constant times times that count. The density assumption with finishes the argument.
Carmichael number Created 2026-09-24 Updated 2026-10-18
A Carmichael number is a composite number for whichEvery 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]
Carmichael Numbers and Korselt's Criterion by Keith Conrad. Definition 1, printed p. 1: composite input and coprime bases
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 givesThe 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.
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]
Zbytky z arithmetické posloupnosti by Václav Šimerka. Zbytky z arithmetické posloupnosti, printed p. 224, §9: list beginning with 561 and 1105; archive title sheet identifies Václav Šimerka and 1885
Character sum of a Dirichlet character Created 2026-10-06 Updated 2026-10-07
A character sum of a Dirichlet character is a finite sum such as or the weighted sum . Orthogonality of Dirichlet characters converts residue class restrictions to these sums.
Collatz prefix family Created 2026-10-20 Updated 2026-11-05
Fix a finite word of even and odd steps for the Collatz sequence, with for even and for odd . A Collatz prefix family is the set of starting integers whose first steps realize that word. Every member must satisfy both the resulting affine formula and the parity conditions at each intermediate step.
For the prefix odd, even, odd, write . Then must be odd, so is odd and . Conversely every positive integer in that residue class realizes the prefix. The construction describes a finite segment of behavior and asserts nothing about the later termination of the trajectory.
Commutative ring Created 2026-09-24 Updated 2026-10-14
A commutative ring is a ring in which multiplication satisfies for every pair. The integers and the polynomial ring are examples. So is , the quotient ring whose elements are residue classes in modular arithmetic. We represent these by and reduce each sum or product to its remainder. All following calculations modulo use this convention.
In , , although neither factor is zero. Thus and are zero divisors: nonzero elements whose product with another nonzero element can vanish. Also . Removing the common factor would falsely assert . The entire row for multiplication by isThe repetitions explain the linear congruences directly. The equation has exactly the two solutions , whereas has none. A common factor can erase information, and a nonzero coefficient does not guarantee that an equation has a solution.
A unit in a ring is an element with a multiplicative inverse, meaning for some . In , the units are exactly and , since . The other nonzero elements, , are zero divisors; for , use . In a nonzero commutative ring, a unit cannot be a zero divisor: multiplying by its multiplicative inverse forces . But a nonzero element need not be a unit or a zero divisor: the integer is neither in .
By contrast, in , every row for a nonzero multiplier is a permutation of . Each such row contains exactly once, giving a multiplicative inverse: , , , and . Hence this commutative ring is a field. For example, now has the unique solution . Reading the tables reveals which algebraic steps the arithmetic permits.
Complementary factorial congruence Created 2026-10-05 Updated 2026-10-14
For a prime number and nonnegative integers , Wilson theorem gives by replacing the last factors of with . For odd , have the same parity; for , both signs have the same residue class. Thus , including the endpoint cases .
Complete Legendre-symbol sum Created 2026-09-29 Updated 2026-11-05
For an odd prime , the complete sum of the Legendre symbol isChoose a quadratic nonresidue . Multiplication by permutes the finite field , while multiplicativity of the Legendre symbol gives . The sum is therefore equal to its own negative, and is zero. Equivalently, among the nonzero residue classes, exactly half are quadratic residues and half are quadratic nonresidues; the zero term contributes zero.
For any sequence of integers, some nonempty consecutive block has sum divisible by . Form the prefix sums . There are only residue classes modulo , so the pigeonhole principle gives for some . Subtraction proves that is the required block sum. Negative entries and repeated entries cause no difficulty. Applied after any ordering of a finite set, it also gives a nonempty subset whose sum is divisible by the size of the set.
Cyclic convolution 2026-10-20
For arrays indexed by integers modulo , their cyclic convolution isWhen and count choices with respective residue classes and , the cyclic convolution counts pairs whose sum has residue class . Repeated cyclic convolution therefore counts sums of longer sequences. The discrete Fourier transform converts cyclic convolution into pointwise multiplication.
Direct product of groups Created 2026-09-24 Updated 2026-10-20
A direct product combines two groups into one while keeping their operations in separate coordinates. Its underlying set is the Cartesian product , and its group operation isThe identity element is , and the inverse element of is . Associativity follows coordinate by coordinate. For finite groups, the multiplication principle gives .
For example, write the cyclic group as the additive group of residue classes modulo . In ,since each coordinate reduces with its own integer modulus. A pair can track two cyclic counters that advance independently. Updating the first coordinate does not alter the second, and vice versa.
This independence has an algebraic form. The embedded factor elements always commute:The coordinate maps and are group homomorphisms, so one can analyze either component separately. This does not make the full product an abelian group when one of its factors is nonabelian: two arbitrary pairs need not commute.
The construction is useful in both directions. It builds a larger group from familiar pieces, while the internal direct product theorem recognizes when an existing group can be separated into such pieces. A cyclic group can sometimes be split this way; whether two finite cyclic factors combine into one cyclic group is decided by the cyclicity of a product of two finite cyclic groups. Definitions and the basic recognition theorems are developed in Thomas Judson, Abstract Algebra: Theory and Applications, §9.2, Direct Products.
Discriminant criterion for a quadratic congruence modulo an odd prime Created 2026-09-24 Updated 2026-11-05
Let be an odd prime and let be integers with . The quadratic congruencehas a solution exactly when its discriminant is zero or a quadratic residue modulo .
Indeed, completing the square gives the equivalent equationMultiplication by and translation by give a bijection of the residue classes, because is invertible modulo . Each square root of therefore gives exactly one solution .
Consequently the number of distinct solutions is , using the Legendre symbol: one for zero discriminant, two for a nonzero quadratic residue, and none for a quadratic nonresidue. The hypotheses matter: if the equation can become linear, while at division by is unavailable.
Equivalence class Created 2026-10-05 Updated 2026-10-14
An equivalence class collects all the set elements indistinguishable from a specified set element under an equivalence relation. For an equivalence relation on a set , the precise definition isThe ambient set matters: a finite class for integer congruence restricted to differs from the infinite residue class for the same integer congruence on all integers. We write when the equivalence relation and ambient set are clear.
In the finite modulo-three example,There are nine names but only three distinct equivalence classes. In particular, , whereas : the first statement is membership of a set element; the second is equality of two sets.
For any equivalence relation on , the essential rule isReflexivity puts in , so the equivalence classes are nonempty and cover . If two equivalence classes share , the symmetric relation property and transitivity relate their defining elements through ; transitivity then makes their members coincide. Thus distinct equivalence classes are disjoint, giving a partition of a set. Conversely, declare two set elements equivalent when they belong to the same block of a partition of a set. The three relation properties follow immediately and its equivalence classes recover the blocks. [ref]
https://www.math.umd.edu/~pbrosnan/notes/ugalg/sect0018.html. Patrick Brosnan, Undergraduate Algebra, §2.10, Lemma 2.81, Corollary 2.82 and Theorem 2.83
Fermat little theorem Created 2026-09-24 Updated 2026-10-14
For a prime number and an integer not divisible by , Fermat's little theorem states the modular congruenceEquivalently, for every integer , including and multiples of ,The first formulation follows from the second by multiplying by a modular multiplicative inverse of . Conversely, multiply the first by when ; when , both sides of the second are zero modulo . The divisibility condition in the first formulation is essential.[ref]
For , , so and . Also , while : a zero residue class cannot satisfy the first formulation. It does satisfy . A failure at a zero residue class therefore says nothing against a candidate's being a prime number.
The prime number is included. Its only nonzero residue class is one: every odd integer satisfies . Every integer also satisfies , because is even. Testing the first formulation with an even integer would violate its hypothesis.
The useful surprise is that every nonzero residue class returns to one at the same exponent , although its shortest return can be earlier. This gives exponent reduction for units: for a nonnegative integer , when . It also computes a modular multiplicative inverse as modulo , including . Repeated squaring makes these modular exponentiations practical.
In group theory, the nonzero residue classes form the multiplicative group of integers modulo n with , of group order . Lagrange's theorem says that the multiplicative order of divides , giving the guaranteed return. Euler's theorem extends this to a general integer modulus , using the units and Euler's totient function ; the Carmichael function gives the least common return exponent for all units. A nonzero residue class modulo a composite number need not be a unit.
Leonhard Euler's paper presented in 1732 and published in 1738 states a historical formulation: Theorem 1 says that powers with exponent leave zero or one upon division by a prime number . The preceding discussion states the difference-of-powers version and explicitly says that he does not have its proof.[ref]
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]
Fermat's Test by Keith Conrad. Keith Conrad, Fermat's Test, p. 2, Definition 2.4 and footnote 3 on the two witness conventions
Gauss's lemma (number theory) Created 2026-10-14 Updated 2026-11-05
Let be an odd prime and an integer with . Reduceto their least positive residue classes modulo . If exactly of these representatives exceed , Gauss's lemma statesThe symbol on the left is the Legendre symbol. For example, and give representatives . Exactly one exceeds , so is a quadratic nonresidue modulo .
For a proof, replace every representative above by its negative modulo , obtaining numbers in . These numbers are distinct: equality would give , forcing because . They therefore form a permutation of . Multiplying the signed representatives givesThe factorial is invertible modulo . Cancelling it and applying the Euler criterion proves the lemma. Counting signs can thus replace a potentially large modular exponentiation.
Infinite pigeonhole principle Created 2026-09-24 Updated 2026-10-14
The infinite pigeonhole principle says that if an infinite set has a partition of a set into finitely many parts, at least one part is an infinite set. Equivalently, assigning infinitely many objects to a finite number of boxes forces some box to contain infinitely many objects. For example, separating the natural numbers into their two residue classes modulo forces at least one class to be an infinite set; here both are, as the lists and show.
Proof outline. A union of finitely many finite sets is a finite set. If all the parts were finite sets, their union could not be the original infinite set.
The assumption of finitely many parts is essential. With one box labelled by each natural number, assigning to box puts exactly one object in every box. Infinitely many objects and infinitely many boxes therefore need not produce even a shared box. The infinite pigeonhole principle is useful whenever finitely many labels organize an endless collection: one label must keep occurring infinitely often, providing an infinite set on which that label is constant.
Integers with all prime factors congruent to one modulo four Created 2026-10-06 Updated 2026-10-14
A positive integer in this set has no prime factor equal to two or congruent to three modulo four. Its prime factors all lie in the residue class one modulo four. For example belongs, while does not, even though itself is congruent to one modulo four. A half-dimensional interval sieve bounds the count in an interval of length by .
Internal direct product theorem Created 2026-10-03 Updated 2026-10-14
An internal direct product finds independent coordinates already present inside a group. Let be normal subgroups of withThen the multiplication mapis a group isomorphism. Thus every element of has a unique factorization into one element of each subgroup. Conversely, the embedded factors and inside an external direct product of groups satisfy these conditions.
For a concrete example, take the additive cyclic group and its subgroups and . They are normal subgroups because is an abelian group. Their intersection is , and the sums give every residue class exactly once. For instance, . The table makes the unique decomposition visible.
The proof explains each hypothesis. Normality puts the group commutator in both and , so it is the identity element. Therefore the factors commute, and preserves the group operation. The condition makes it surjective. If , then belongs to the intersection, forcing both to be the identity element; thus its group kernel is trivial and it is injective.
Normality cannot simply be omitted. In the symmetric group , take and . Their intersection is trivial and , but is not a normal subgroup. With permutations composed right to left, while , so the factors do not commute. The setwise decomposition is unique, but its multiplication map is not a group homomorphism from . An independent-coordinate interpretation requires the group operations to agree, not merely a bijection of the underlying sets.
Jordan's totient function Created 2026-10-13 Updated 2026-11-05
For positive integers , Jordan's totient function counts tuples of residue classes modulo for which . The coordinates together must avoid a common prime divisor of ; they need not each be units.
For each prime factor of , exactly tuples have all coordinates divisible by . The inclusion-exclusion principle, applied to simultaneous divisibility by the distinct prime factors, therefore givesIn particular is Euler's totient function. For , the formula gives . The pair is counted because , even though neither coordinate is coprime to six.


