Fundamental theorem of arithmetic Created 2026-09-24 Updated 2026-10-20
Every integer is a product of prime numbers, uniquely up to reordering the factors. More precisely, there are unique distinct prime numbers and unique positive integer exponents such thatIn the header's displayed form, is the prime valuation, the exponent of in this prime factorization; it is zero when does not divide . Reordering or regrouping the prime factors does not give a different prime factorization.
For , repeated division gives , , , then , , and . ThusIts nonzero prime valuations are , and . Recording only the distinct prime factors would lose the difference between and .
This turns divisibility into coordinatewise comparison of nonnegative exponents. A positive divisor of chooses an exponent from for , from for , and from for , giving positive divisors. The greatest common divisor takes the smaller exponent at each prime number; the least common multiple takes the larger. The theorem is a structural description, not an assertion that finding the factors of every large integer is computationally easy.
In general, for positive integers , the exact divisibility criterion isFor example, divides , with quotient , whereas does not: it requires four factors of two, but supplies only three. Both use only prime factors of , so membership in that list alone does not establish divisibility. Every positive divisor of is uniquely with , , . Sorted, all 24 positive divisors areThus the divisor function gives . These include divisors that are composite numbers, as well as the prime factors and one.
For another positive integer , the prime valuations give exact formulas for the greatest common divisor and least common multiple:With and , their prime valuations at are and . The smaller exponents give , and the larger give , henceIndeed, , , and . The same rules also explain : the smaller and larger exponents sum to the two original exponents. Here .
Prime valuations compute the greatest common divisor, least common multiple and all 24 positive divisors of 360
. The upper table compares exponents at the prime numbers for and , then takes their columnwise minimum and maximum. The lower tables enumerate for and ; each cell gives one positive divisor. Details.The useful change of viewpoint is that multiplication becomes addition of prime valuations, , and divisibility becomes comparison. Many different-looking calculations therefore share one representation. The prime valuations are coordinates for multiplication, rather than digits in positional notation: they do not turn ordinary addition of integers into coordinatewise addition.
Different intermediate splits lead to the same prime ingredients. Starting with gives and ; starting with gives and . Continuing to split the composite numbers produces the same multiset of prime factors: three twos, two threes, and one five. The factorization tree records choices in the calculation, while the prime factorization records the invariant result.
The proof outline explains the uniqueness. Existence follows by splitting a composite number into smaller factors until only prime numbers remain. For uniqueness, Euclid's lemma says that a prime factor of one product must divide one factor of any other prime product equal to it. That factor must be the same prime number; cancel it and repeat. The crucial divisibility step appears in Book VII, Proposition 30 of Euclid's Elements. [ref]
https://mathcs.clarku.edu/~djoyce/java/elements/bookVII/propVII30.html. Euclid, Elements VII.30: a prime divisor of a product
The ancient text supplies specific precursors to the modern statement: Book VII, Proposition 31 establishes that every composite number has a prime factor, and Book IX, Proposition 14 excludes any new prime factor from the least common multiple of given prime numbers. These are the propositions being cited, rather than the complete modern exponent formulation of the fundamental theorem of arithmetic. [ref]
https://mathcs.clarku.edu/~djoyce/java/elements/bookVII/propVII31.html. Euclid, Elements VII.31: every composite number has a prime divisor
[ref]https://mathcs.clarku.edu/~djoyce/java/elements/bookIX/propIX14.html. Euclid, Elements IX.14: prime divisors of a least common multiple of primes
Excluding one from the prime numbers keeps uniqueness meaningful: otherwise would give different collections of supposed prime factors. For , the natural convention is the empty product, equal to one, with no prime factors and all prime valuations zero.
Inclusion-exclusion principle Created 2026-09-24 Updated 2026-10-13
For finite sets , the cardinality of their union isAdd the individual cardinalities, subtract pairwise intersection counts, add triple intersection counts, and continue alternating. This is useful whenever one object can satisfy several conditions: a search result can match several filters, or a permutation can have several forbidden fixed points.
Among the integers from 1 to 30, let contain the multiples of 2 and the multiples of 3. Then , , and , because their common multiples are the multiples of 6. The naive sum counts those five twice; the correct union size is . The regions contain ten in alone, five in both, five in alone, and ten in neither.
Subtracting overlap counts each selected integer once; a third divisibility condition requires adding the triple overlap back
. Details. Add a third set containing the multiples of 5. Its size is 6; the three pairwise intersections have sizes ; and the triple intersection contains only 30. The inclusion-exclusion principle gives integers divisible by at least one of 2, 3, and 5.
The alternating corrections have a local explanation. An object belonging to exactly of the sets is counted times, by the binomial theorem applied to . An object in none contributes zero. Thus overlapping descriptions are repaired without requiring the sets themselves to be disjoint. For probability, the same calculation applies to event probabilities in place of cardinalities, giving the inclusion-exclusion principle for probabilities.
Integer congruence 2026-10-14
For a positive modulus , integers are congruent when their difference is divisible by . This is an equivalence relation: zero is divisible by , changing sign preserves divisibility, and adding two divisible differences proves transitivity. Addition and multiplication respect it, because and . Its equivalence classes are the residue classes used in modular arithmetic.
Legendre's formula Created 2026-10-14 Updated 2026-10-18
For a nonnegative integer and a prime number , the Legendre formula computes the prime exponent in a factorial without forming that huge product:Here is the floor function. The sum is finite: every term with is zero. When , all terms vanish, agreeing with and . The prime number hypothesis matters: a composite number does not give the same P-adic valuation or additive prime exponent. For example, the floor sum with is one, whereas divides .
Why count multiples repeatedly? Each multiple of in contributes one factor of ; each multiple of contributes another; and so on. A factor with P-adic valuation occurs in exactly the first counts. Adding those contributions proves the formula.[ref]
Number Theory for Mathematical Contests by David Anthony Santos. David A. Santos, Number Theory for Mathematical Contests, revision 31 October 2007, §8.3, Theorem 245, printed pp. 89–90: factorial valuation and digit form
For the original example ,The five multiples each contribute a second factor of three. The factor contributes a third, so it appears in all three rows. Equivalently, among there are eleven factors of P-adic valuation one, four of valuation two, and one of valuation three: . Thus divides , while does not.
Nested multiples count the factors of three in
. Each colored cell contributes one to the P-adic valuation. Multiples of nine occur in two rows, and occurs in three. Summing by rows gives ; summing by columns gives . Factors not divisible by three contribute zero and are omitted. Details.Repeated Euclidean division provides a practical evaluation: replace by , starting from , and add each new quotient until it is zero. This uses only the successive quotients for the example. The same calculation handles divisibility of binomial coefficients, where the P-adic valuations of the denominator factorials are subtracted.
Linear congruence Created 2026-09-29 Updated 2026-10-14
A linear congruence asks for the integers satisfying , where are integers and . Let be their greatest common divisor. There are solutions exactly when divides . When solutions exist, there are exactly solution classes modulo , obtained from one solution byThe divisibility condition follows immediately from : every common divisor of must divide . Conversely, Bézout's identity constructs a solution when . Differences between any two solutions obey , equivalently , since and are coprime. This explains both the spacing and the number of solution classes.
For a complete example, solve . Here divides nine. Dividing the corresponding divisibility statement by three changes the integer modulus too:Because , multiplying by the modular inverse three gives . Lifting this class back to modulus fifteen yields . Direct substitution gives , and , each with remainder nine after division with remainder by fifteen. By contrast, has no solutions, because three does not divide ten.
This is why ordinary-looking division cannot be performed blindly in modular arithmetic. Reducing the equation and its integer modulus together keeps all solutions; retaining modulus fifteen after dividing by three would lose valid classes. When , the modular inverse of exists and gives a unique class . The Euclidean algorithm computes the Bézout coefficients needed for this construction. [ref]
https://ocw.mit.edu/courses/18-200-principles-of-discrete-applied-mathematics-spring-2024/mit18_200_s24_lec15.pdf. Moitra, MIT 18.200, Lecture 15, modular inverses and the extended Euclidean algorithm
Logical implication Created 2026-09-28 Updated 2026-10-25
Logical implication forms the proposition , read “if , then ”. In classical propositional logic, it is false exactly when is true and is false. Equivalently, it has the same truth table as , using logical negation and logical disjunction. A false hypothesis makes the logical implication true regardless of its conclusion; thus it asserts neither the hypothesis nor a causal connection.
For example, for every natural number , divisibility by four implies that is an even number: . At , both statements are true. At , the hypothesis is false and the conclusion true; at , both are false. The only forbidden case is a multiple of four that is not an even number.
In Intuitionistic propositional logic, a proof of consists of a construction transforming any proof of into a proof of . The implication introduction rule proves under a temporary assumption ; the modus ponens rule applies the result when is available. The classical identification with is not generally intuitionistically valid.
Modular arithmetic Created 2026-10-03 Updated 2026-10-18
Modular arithmetic performs addition and multiplication on integers while remembering only their remainders for a fixed positive integer modulus . The relation means that divides : the two integers lie in the same congruence class. For example, , and represent one class modulo . Choosing the least nonnegative residue gives exactly representatives, , even though each congruence class contains infinitely many integers.
A clock supplies a familiar example. Represent the twelve positions by , with at the position usually labelled twelve. Starting at ten and moving seven positions givesThe integer congruence records the final position; it discards the number of complete revolutions. Adding another twelve changes the elapsed count while preserving the position. The picture also shows a single congruence class modulo five spread along the number line.
The useful surprise is that discarding this information still preserves the arithmetic. If and modulo , then and modulo . Thus a large calculation can reduce its intermediate integers after every step. For instance,Replacing by gives the same answers with smaller intermediate values. The congruence classes with these operations form the quotient ring ; their addition alone forms a cyclic group. This passage from integers to a finite arithmetic system is the setting for modular exponentiation, primality testing and the RSA cryptosystem. [ref]
https://ocw.mit.edu/courses/18-200-principles-of-discrete-applied-mathematics-spring-2024/mit18_200_s24_lec15.pdf. Ankur Moitra, MIT 18.200, Lecture 15, modular arithmetic and its applications
Multiplicative cancellation needs extra care. Modulo six, , but : multiplication by two has merged distinct congruence classes. Cancelling a factor while retaining the integer modulus is justified when that factor has a modular multiplicative inverse, equivalently when it is coprime to the integer modulus. A linear congruence can consequently have no solutions, one solution class, or several solution classes. The Chinese remainder theorem supplies a complementary operation: splitting a calculation across coprime integer moduli and reconstructing its class modulo their product.
Small remainders can also certify impossibility. A perfect square has residue zero or one modulo four, as checking the four congruence classes shows. Therefore an integer equation has no solution. The converse direction needs care: a permitted residue does not guarantee an integer solution, since but five is not a perfect square. Such local tests provide necessary conditions for Diophantine equations without replacing the full problem.
In Disquisitiones arithmeticae (1801), Carl Friedrich Gauss defines integer congruence in article 1 and adopts the symbol in article 2. Article 12 derives divisibility tests from powers of ten and explains checking arithmetic by its remainders. These passages show a systematic treatment of the same idea; they are not a claim that remainders were first used in 1801. [ref]
https://la.wikisource.org/wiki/Disquisitiones_arithmeticae/Sectio_prima. Gauss, Disquisitiones arithmeticae, section I, articles 1–2 and 12; text from the 1870 collected edition
Modular congruence Created 2026-09-24 Updated 2026-10-31
For integers and a positive integer modulus , modular congruence meansThus for some integer : the two integers differ by complete cycles of length . For example, because , and because . A modular congruence need not be an equality of integers.
On a twelve-position clock labelled , adding five to nine follows . Hence : the final position remembers the remainder while forgetting a complete revolution.
The same idea tracks any count repeating every steps. It also lets us compute sums and products with small residue classes, reducing intermediate results without changing the final class. The justification comes from addition and multiplication being well-defined on residue classes.
In Disquisitiones arithmeticae (1801), Carl Friedrich Gauss defines modular congruence by divisibility in article 1; article 2 describes the integers and adopts . These passages document his presentation and notation, without claiming that repeating remainders began in 1801. [ref]
https://la.wikisource.org/wiki/Disquisitiones_arithmeticae/Sectio_prima. Gauss, Disquisitiones arithmeticae, section I, articles 1–2; original text in the 1870 collected edition
Nonzero residue permutation 2026-10-14
For a prime number and , multiplication by gives a permutation of the nonzero residue classes. For modulo seven, the representatives map to : the same collection in a different order. Repeating this permutation from one visits all six representatives before returning.
For modulo seven, the permutation cycles are instead and . The powers of two visit only the permutation cycle containing one, so their multiplicative order is three. Both permutation cycles return after three steps; applying the permutation six times still fixes every nonzero residue class. Fermat's little theorem guarantees a return at six, not that every base visits every nonzero residue class.
More generally, every permutation cycle of this map has length equal to the multiplicative order of : starting at a nonzero residue class , a return means , and its modular multiplicative inverse allows cancellation of . Thus the nonzero residue classes split into equal-length permutation cycles, which also explains the divisibility of the multiplicative order into .
The product argument gives a short proof outline. Since multiplication by is a permutation of the nonzero residue classes,Every factor is a unit, so their product has a modular multiplicative inverse and can be cancelled. This leaves . The whole argument works for , where the product is just one.[ref]
Number theory Created 2026-09-24 Updated 2026-10-13
Number theory studies integers, their divisibility, and the patterns created by prime numbers. Its questions often have short statements but rigid answers: which integers divide a given one, when does an equation have integer solutions, and when can arithmetic with congruence classes be reversed? The Euclidean algorithm and modular multiplicative inverses connect these questions through explicit calculations.
For example, and . Their shared prime factors give greatest common divisor . The Euclidean algorithm reaches that answer without finding either complete prime factorization. It also produces , an instance of Bézout's identity. This relation certifies every common divisor at once and solves an associated linear Diophantine equation.
Modular arithmetic retains only remainders, but the lost information can be surprisingly controlled. Multiplication by modulo is a permutation of all residue classes, because has modular inverse . Multiplication by modulo collapses fifteen residue classes to three. Thus an apparently small change in the modulus changes whether a calculation can be reversed. The Chinese remainder theorem explains another kind of compression: remainders modulo coprime integers can be combined into one remainder modulo their product.
Simple restrictions help reveal the structure without telling the whole story. Every prime number greater than three is congruent to or modulo : the other four residue classes force divisibility by or . The converse fails because and lie in those classes but are composite numbers. Necessary conditions are useful filters, not substitutes for primality testing.
The subject's appeal lies partly in this tension: prime factorization gives a clean description of every positive integer, while identifying factors and predicting their distribution lead to substantial further questions. Analytic number theory uses tools from analysis to study global patterns, and algebraic number theory extends arithmetic into number fields. Applications include cryptography and error-correcting codes; MIT's discrete applied mathematics course develops modular structures for both purposes. [ref]
https://ocw.mit.edu/courses/18-200-principles-of-discrete-applied-mathematics-spring-2024/mit18_200_s24_lec15.pdf. Ankur Moitra, MIT 18.200, Modular Arithmetic and Elementary Algebra, 2024, introduction
Euclid's Elements already gives a greatest-common-measure construction in Book VII, Proposition 2, and the argument that a finite list cannot exhaust the prime numbers in Book IX, Proposition 20. These are documented ancient treatments, rather than evidence that all of number theory began with one author. [ref]
https://mathcs.clarku.edu/~djoyce/java/elements/bookVII/propVII2.html. Euclid, Elements VII.2, translated text hosted by David Joyce
[ref]https://mathcs.clarku.edu/~djoyce/java/elements/bookIX/propIX20.html. Euclid, Elements IX.20, translated text hosted by David Joyce
p-adic absolute value Created 2026-09-24 Updated 2026-10-14
Fix a prime number . Write a nonzero rational number as , where and the nonzero integers are not divisible by . The exponent is uniquely determined. Its P-adic valuation is this signed exponent : equivalently, for any nonzero integer numerator and denominator ,Factors of in the numerator decrease the p-adic absolute value; factors in the denominator increase it. For the computations are:
| Rational number | Factorization | P-adic valuation | 2-adic absolute value |
|---|---|---|---|
| Not applicable | by convention |
This is an absolute value on a field measuring divisibility, rather than the magnitude on a real number number line. It satisfiesThe proof comes directly from P-adic valuations: exponents add in a product of numbers, and extracting a common power of from a sum gives . If the two P-adic valuations differ, the remaining term with smaller exponent cannot cancel modulo , so equality holds. Thus the p-adic absolute value is a Non-Archimedean absolute value. [ref]
The metric makes two rational numbers close when their difference contains a high power of . This packages successive modular congruences into a numerical error estimate, allowing convergence in a metric space and convergent series to encode exact arithmetic information.
An element is a prime element when it is nonzero and not a unit, and implies or . If and is a prime element, assume for example . Cancellation in gives , so is a unit. This proves every prime element is an irreducible element.
In a Euclidean domain, each nonzero ideal has a generator of least Euclidean value: division of another member by that generator leaves a remainder in the ideal of smaller value, so the remainder must vanish. Let be an irreducible element and suppose but . Write . Since , irreducibility says is a unit or is associate to . The second case would give , so is a unit. Hence for some . Multiplying by shows . Thus irreducibles in a Euclidean domain are prime.
For , use the multiplicative integer field norm . Units have field norm one and are exactly . If were a product of nonunits, their norms would be integers greater than one multiplying to four, hence both would have field norm two. But has no integer solution: makes the left side at least seven, and would give . Therefore 2 is an irreducible element.
On the other hand,is divisible by 2, while neither factor is, because divisibility by 2 requires both integer coefficients to be even. Thus 2 is not a prime element in this ring. It is also not a prime element in : , but . In fact is already a nontrivial factorization there.
Past exam of the history of mathematics course of the University of Oxford 2023 1 Solution 2026-10-25
The passage belongs to the English reception of Euclid's number theory. Henry Billingsley's The Elements of Geometrie by Henry Billingsley, published in 1570, brought the Elements into English with extensive explanatory material. The original title page advertises translation and annotations; the extract's worked examples show what explanatory prose could add to a compact definition. Henry Billingsley's numbering calls this Definition 23 of Book VII; the familiar modern numbering is VII, Definition 22. The difference is editorial, not a difference in the perfect number being defined.[ref]
The Elements of Geometrie by Henry Billingsley. Title page and Book VII, Definition 23, in the Text Creation Partnership transcription
[ref]Book VII, Definition 22. Definition and guide
Here a number's parts are its positive proper divisors, rather than arbitrary pieces of a sum or all smaller integers. In modern notation the definition iswhere is the sum-of-divisors function. Thus is not a perfect number: its positive proper divisors total . It is essential to exclude itself: including it would double the required sum. The pairing of a divisor with the fraction of the whole explains the extract's language of halves, thirds and so on. Its examples are complete checks because they identify every positive proper divisor, not merely some convenient decomposition.
The larger mathematical context is the construction in Book IX, Proposition 36. If is a prime number, then is a perfect number. To reconstruct the argument, prime factorization gives all its divisors as and , with . A finite geometric series therefore givesThe choices produce . The primality assumption matters: choosing produces , whose sum-of-divisors function is , not . The construction gives a reason for the examples and connects perfect numbers with Mersenne primes.[ref]
Book IX, Proposition 36. Statement, construction and guide
The extract itself supplies a definition and examples, not a classification or a mathematical proof that such numbers are rare. In particular, the converse that every even perfect number has this form belongs to the later Euclid-Euler theorem; it should not be read back into this passage. The historically significant feature is the transmission of deductive arithmetic through vernacular explanation: a book called geometry also teaches the divisibility theory needed for a general construction.
Past exam of the mathematics course of the University of Cambridge 2004 ia Paper 4 2E Solution Created 2026-09-24 Updated 2026-10-14
For the odd-square sum, the initial case gives . Assume the formula at . Adding the next square givesThe initial case and this induction step prove for every positive integer .
For the divisibility assertion, . The change when is replaced by isOne of the consecutive integers is even, so the displayed change is divisible by . If is divisible by , its successor is too. Thus induction proves for every .
Past exam of the mathematics course of the University of Cambridge 2022 ii Paper 2 18H a Solution Created 2026-09-24 Updated 2026-09-25
If the minimal polynomial of has degree , then
has elements and is an intermediate field of
. The tower law for field extensions givesso .
has elements and is an intermediate field of
. The tower law for field extensions givesso .
The multiplicative group of a finite field is cyclic. Choose a generator
of , of order . If lay in a proper intermediate field of degree , its order would divide , a contradiction. Thus
and its minimal polynomial has degree .
of , of order . If lay in a proper intermediate field of degree , its order would divide , a contradiction. Thus
and its minimal polynomial has degree .
For arbitrary , let be the splitting field of
over . Its roots form a field: the Frobenius endomorphism shows they are closed under addition, subtraction, multiplication, and inversion. The derivative is , so there are exactly distinct roots. Thus this root field has order . Applying the preceding generator argument supplies an element whose minimal polynomial over has degree , proving that an irreducible polynomial of every positive degree exists.
over . Its roots form a field: the Frobenius endomorphism shows they are closed under addition, subtraction, multiplication, and inversion. The derivative is , so there are exactly distinct roots. Thus this root field has order . Applying the preceding generator argument supplies an element whose minimal polynomial over has degree , proving that an irreducible polynomial of every positive degree exists.
Past exam of the mathematics course of the University of Cambridge 2022 ii Paper 2 20H b Solution Created 2026-09-24 Updated 2026-09-25
The Dedekind factorization theorem says that, when a rational prime does not divide the index of an order , a factorizationof the minimal polynomial modulo gives
Let with square-free , and let be odd. The resulting splitting of rational primes in a quadratic field is:
Finally suppose and
has norm , with integers
chosen coprime. ThenIf an odd ramified, then . Reduction modulo gives
. Since is not a square modulo such a prime, . Dividing the equation's divisibility shows as well (use that square-free has -adic valuation one), contradicting coprimality. Hence no prime ramifies.
has norm , with integers
chosen coprime. ThenIf an odd ramified, then . Reduction modulo gives
. Since is not a square modulo such a prime, . Dividing the equation's divisibility shows as well (use that square-free has -adic valuation one), contradicting coprimality. Hence no prime ramifies.
The set is nonempty because . By the well-ordering principle for the natural numbers, it has a least element . In particular and divides .
If were not a prime number, it would have a positive integer divisor with . Since divides and divides , divisibility is transitive and divides . This would put in , contradicting the minimality of . Hence .
Expand the ring first-order language by a new constant and considerEvery finite subset is satisfiable in the integer ring itself. Only finitely many divisibility conditions occur; interpret as a nonzero common multiple of their positive integer indices, using if none occur. All first-order sentences from are automatically true there.
Compactness theorem therefore gives a first-order model. Its reduct to the original ring first-order language satisfies the complete theory of , so . Its element is nonzero and divisible by every positive standard integer. ThusSuch an element cannot be an ordinary nonzero integer, since an integer of absolute value less than cannot be a nonzero multiple of . The statement concerns each standard integer index separately; it does not assert divisibility by every internally nonzero element of .
Enumerate the standard positive primes as . For each subset consider the partial typewhere divisibility is the ring logical formula .
Every finite subset is realized in : take the product of the finitely many primes required to divide , or if there are none. This is nonzero and is not divisible by any of the distinct finitely many primes required not to divide it. Compactness theorem supplies a complete type extending .
Distinct subsets yield distinct complete extensions, because at an index in their symmetric difference they require opposite divisibility statements. There are such subsets, so there are at least that many complete one-types. There are at most that many because the first-order language has only countably many logical formulas and a partial type is a set of them. HenceIn particular the number of complete one-types is uncountable, despite every partial type realized in the particular countable first-order model being a principal complete type.
Fermat's little theorem states that for a prime and an integer not divisible by ,Equivalently, for every integer , with divisibility by allowed in that latter formulation.








