Prime valuation Created 2026-09-24 Updated 2026-10-13
For a prime number and a positive integer , the prime valuation is the exponent of in the prime factorization of , equivalently
Thus because divides but does not; , and . In particular . Multiplication adds prime valuations, , and the fundamental theorem of arithmetic makes comparison of prime valuations an exact test for divisibility between positive integers. This definition extends to a nonzero integer by taking its absolute value; for zero one commonly sets .
Procedure type 2026-10-31
A data type describing a callable procedure's parameter types and any return type. A traversal callback taking an integer and producing no data result can be passed using an Oberon declaration such as Visit = PROCEDURE(x: INTEGER).
Programming language Created 2026-10-13 Updated 2026-10-14
A programming language specifies how programs are written and what their execution means. Its type system describes which operations may be combined; an abstract syntax tree records the structure on which these rules act. The examples under type system use a small teaching language with integers, Boolean values and function types.
// Target: computer-science.bigb
Progressive number 2026-10-20
A positive integer for which some division with integers and has as consecutive terms of a geometric progression in some order. Writing a reduced common ratio as with and , the three terms have the form for a positive integer .
Proof of Korselt criterion Created 2026-10-14 Updated 2026-10-18
For sufficiency, let be composite and squarefree, with for every prime factor . For any integer coprime to , Fermat's little theorem gives for every such . Their product is , so the Chinese remainder theorem gives the required congruence modulo .
For necessity, first rule out a repeated factor. If with and , the Chinese remainder theorem supplies and . This is coprime to . But the binomial theorem gives
contradicting the Carmichael number condition. Hence is squarefree.
Now choose a primitive root modulo a prime factor . Lift it to a unit modulo by prescribing and . The Chinese remainder theorem applies because is squarefree. The Carmichael congruence implies . Since has multiplicative order , that order divides . This proves the other condition.[ref]
Pushforward of a finite probability distribution Created 2026-10-25 Updated 2026-10-31
For a finite probability distribution with support and a total function , assign each image value the combined mass of its preimages. Its support is exactly the finite image , listed without repetitions. Every listed mass is positive because it contains at least one positive source mass.
The fiber of a function construction gives a set partition of , so finite summation gives . This proves nonnegativity and normalization without assuming that is injective. In code, mapping support values and then overwriting repeated image keys is incorrect; repeated keys must have their masses added. For example, mapping a uniform distribution on four consecutive integers to parity produces two outcomes with mass one half each.
Pythagorean triple Created 2026-10-05 Updated 2026-10-20
A Pythagorean triple consists of three positive integers satisfying . It is primitive when their greatest common divisor is one. Reducing their square numbers modulo shows that at least one leg is divisible by ; reducing modulo shows that both legs cannot be odd.
Quadratic nonresidue Created 2026-09-24 Updated 2026-10-18
A nonzero congruence class modulo an odd prime is a quadratic nonresidue when it is not a square. In the convention of quadratic residue, zero belongs to neither class. Thus are the quadratic nonresidues modulo seven, while are the quadratic nonresidues modulo eleven. No integer satisfies , as the complete square map under quadratic residue shows.
A quadratic nonresidue is not an arithmetic dead end: multiplying by any fixed quadratic nonresidue exchanges the quadratic residues and the quadratic nonresidues. If were a square for a square , division by would make a square. Hence consists entirely of quadratic nonresidues; it has elements, because multiplication by nonzero is a bijection. It therefore equals the entire other coset of the quadratic residue subgroup. Modulo seven, .
The product of two quadratic nonresidues is consequently a quadratic residue: write them as in that same coset, and their product is , a square. For example, , whereas remains a quadratic nonresidue. The multiplicativity of the Legendre symbol packages these rules as ordinary sign multiplication.
Quadratic residue Created 2026-09-24 Updated 2026-10-18
For an odd prime , a nonzero congruence class is a quadratic residue when for some integer . Here "quadratic residue" excludes zero: zero is a square of a number, but is neither a quadratic residue nor a quadratic nonresidue under this convention. Some treatments include zero among quadratic residues; the distinction matters when counting them or discussing their subgroup.[ref]
Modulo seven, squaring the six nonzero congruence classes gives
Thus the set of quadratic residues is , and the quadratic nonresidues are . In particular, has exactly the two solutions : and . Modulo eleven the quadratic residues are instead . Two is therefore a quadratic residue modulo seven and a quadratic nonresidue modulo eleven: being a quadratic residue depends on the modulus.
Figure 1.
The square map modulo seven and eleven: two inputs in every nonzero square fiber
. Each pair maps to one quadratic residue. The six nonzero inputs modulo seven give three outputs; the ten modulo eleven give five. The zero fiber is the single input zero, and each quadratic nonresidue has an empty fiber. Details.
Why do the square roots come in pairs? If , the prime number divides , so it divides one factor: or . For nonzero these are distinct, because is an odd prime. Every nonempty nonzero fiber of a function of therefore contains exactly two inputs. Pairing the nonzero congruence classes gives exactly quadratic residues and quadratic nonresidues. Including zero gives different squares, with one rather than two square roots for zero.
The quadratic residues form a subgroup of the multiplicative group of a finite field , with index of a subgroup two. Indeed, one is a square, , and ; the inverses exist because the inputs are nonzero in the prime field. Equivalently, the squaring group homomorphism has kernel of a group homomorphism and image of a function . The apparent loss of a sign in squaring becomes a precise division of the nonzero arithmetic into two equal parts.
This structure turns a search for square roots into a yes-or-no test: Euler's criterion detects quadratic residues through modular exponentiation, and the Legendre symbol records the result as a sign. For a general integer modulus, the modular congruence still makes sense, but the two-root count and the prime field argument need not survive. For example, has four solutions ; the Chinese remainder theorem separates the sign choices modulo three and five.
Quantization maps numerical values to a specified discrete collection of representable values. In lossy block averaging, maps block arithmetic means in to eight-bit integers. Thus and . Different means can share a stored value, making this step irreversible.
Quotient set Created 2026-09-28 Updated 2026-10-14
A quotient set packages each equivalence class as a single new set element. It remembers which class an original set element belongs to and forgets which member of that class it was. For an equivalence relation on a set ,
Each set element of the quotient set is itself a nonempty subset of . The canonical projection of a quotient set sends an original set element to this entire equivalence class. [ref]
For integer congruence modulo three restricted to , the quotient set is
It has cardinality three. The set is a choice of equivalence class representatives, not literally this quotient set: is an integer, while is a set. The function sending each chosen equivalence class representative to its equivalence class is a bijection between these two different sets.
Figure 1.
The quotient projection sends nine elements to three classes, with each class appearing as one fiber
. Details.
A quotient set alone specifies no arithmetic. To obtain the familiar modular arithmetic example with addition, use integer congruence on the whole set of integers. Its quotient set is , where is an infinite residue class. Define addition by
The answer must be independent of the equivalence class representatives. If and , then , so both sums have the same residue class. This is what it means for the group operation to be well-defined. With this addition, the quotient set is a cyclic group, with identity and inverse for . [ref]
For example, . Choosing and as different representatives of an equivalence class for gives the same sum; choosing and gives again. These calculations use residue classes of all integers. Raw addition on the finite does not stay in : . The formula for addition on therefore cannot be applied as a raw inherited operation on that finite example.
Radical of an integer Created 2026-10-06 Updated 2026-10-20
The radical of an integer is the product of its distinct prime factors, each included exactly once. If the prime factorization is with distinct prime numbers and positive integer exponents , then
Thus the radical of an integer remembers which prime factors occur and forgets their prime valuations. At , the empty product gives . The domain of a function here is the positive integers; zero is excluded. [ref]
For example, has distinct prime factors , so . Similarly,
using the prime factorizations , and . The prime omega function counts the retained prime factors, while the total number of prime factors counts their occurrences before repetitions are removed.
The radical of an integer is its largest squarefree divisor. Indeed, a squarefree divisor chooses at most one copy of each prime factor, so it divides ; the radical of an integer itself is a squarefree divisor. Consequently,
The last statement follows because every nonzero prime valuation is then one. It includes , a squarefree integer. Applying the radical of an integer twice also changes nothing: .
Figure 1.
The radical of an integer for : squarefree integers lie on the diagonal, and horizontal families share their prime support of an integer
. Details.
For any positive integers , the exact product rule is
To prove it, a prime factor dividing just one input occurs once in the numerator and not in the denominator. A prime factor dividing both occurs twice in the numerator and once in the denominator, since it divides their greatest common divisor. Each prime factor of therefore remains exactly once. For coprime integers, the denominator is , proving the radical of an integer is a multiplicative function. It is not a completely multiplicative function: .
For a worked example with shared prime factors, take and . Their greatest common divisor is , and , so
This explains why prime support of an integer is useful: questions about the presence of prime factors can discard their multiplicities. For example, the squarefree divisors of are exactly the integer divisors of , namely . Also if and only if , because coprimality depends only on shared prime factors.
A further characterization uses mutual divisibility of powers: for positive integers ,
If their prime supports of an integer agree, sufficiently large make all the required prime valuations large enough. Conversely, these two divisibility relations force each prime factor of either input to divide the other. For and , one can take and : and .
Radix 2026-10-14
The radix is the base of positional notation. In the ordinary integer-base case it is an integer , and successive place values differ by a factor of .
Radix sort key encoding 2026-10-18
An encoding for radix sort must make the intended total order of sort keys agree with the lexicographic order of its fixed-width numerical digit tuples. The positional notation for bounded nonnegative integers has this property. At the most significant differing position , a one-unit numerical digit difference contributes , while all lower positions together contribute at most
This geometric series shows why lower numerical digits cannot reverse that comparison. Leading zero padding works here because it preserves place values and the represented integer.
For signed integers in a known integer interval , encode and choose with . This order-preserving function is also injective: exactly when . For , the four-bit encodings of are after adding eight. Restore the original signed sort keys when displaying the complete sorting records; the encoding need not replace their data. Sorting the unsigned values of raw two's complement bit patterns would put nonnegative integers before negative ones, so their representation alone is not this ordered encoding.
For variable-length strings, first specify the alphabet order and whether a proper prefix precedes its extensions. As an original construction, use , let every string have length at most three, encode as one and as two, and append zeros to width three. Zero is reserved for an end marker strictly below every real symbol. The strings encode as in radix three, which preserves their lexicographic order. A differing real symbol decides the comparison; at a prefix boundary, the shorter string's zero comes before the extension's one or two. Left padding would instead encode as and as , reversing . Padding raw bytes with zero also fails if zero is an allowed data symbol: distinct strings can then receive the same encoding. A reserved end marker and an explicit symbol ordering are essential; byte order alone does not establish a desired human text order.
Figure 1.
Stable ties preserve lower digits; suitable encodings preserve the intended order
. Original counterexample above: reversing a tens tie destroys the units order and a later stable hundreds pass cannot repair it. Below: signed integer offsets and a reserved end marker for bounded strings produce increasing fixed-width encodings. All entries are exact constructed examples. Details.
After passes, , the array is in nondecreasing order of , the integer represented by its lowest numerical digits. Equivalently it is ordered by the tuple under lexicographic order, with the most significant processed numerical digit first. Among equal suffixes it retains the original order of the complete sorting records.
The loop invariant has a simple mathematical induction proof. Before any pass, for every sort key, so the original array satisfies it. Suppose it holds after passes. The next stable digit sort puts smaller groups first and preserves the existing order within each tie. Since
the new array is ordered by . Equal new suffixes have equal current numerical digits and equal old suffixes, so their original order is also preserved. Every pass is a permutation of complete sorting records, establishing sorting permutation preservation. At termination , the assumption gives : the invariant becomes whole-key sortedness, together with stable sorting.
Ramsey number 2026-10-14
For positive integers , the Ramsey number is the least integer such that every red-blue edge coloring of the complete graph contains either a red clique on vertices or a blue clique on vertices. The complete graph has all unordered pairs as edges; every edge gets exactly one color, with no requirement that incident edges have different colors. The definition and its graph interpretation appear in D. Yogeshwaran's Discrete Mathematics notes, section 5.3.
For example, asks how many vertices force a monochromatic triangle in a graph. Swapping colors gives . Also : either a red edge exists, or all edges are blue. On vertices, an all-blue coloring avoids both a red edge and a blue -clique. Under the convention that a one-vertex clique qualifies in either color, .
For , splitting the neighbors of one vertex by the colors of their incident edges gives
Indeed, in a complete graph of the order on the right, at least neighbors are joined to that vertex by red edges, or at least are joined by blue edges. In the red case, the defining property of the smaller Ramsey number supplies either a blue -clique among the neighbors or a red -clique that extends by the chosen vertex; the blue case is symmetric. Starting from the one-vertex base cases, this recursively proves finite existence. The binomial upper bound for a Ramsey number packages the resulting estimate. [ref] present the neighbor argument and the sharp Ramsey number for triangles.
Equivalently, every graph on at least vertices has an -clique or a -element independent set: color its edges red and the edges of its complement graph blue. This is the Ramsey theorem in graph theory. Larger monochromatic patterns have their own thresholds, such as a graph Ramsey number, matching Ramsey number or triangle-packing Ramsey number; these ask different questions from finding one clique.
Random walk Created 2026-09-24 Updated 2026-10-14
A random walk is a stochastic process formed by accumulating random steps. In its additive form, the increments are independent and identically distributed random variables and the position after steps is
The steps can have more choices than and : they may be integers, real numbers, or vectors. A random walk on a graph instead describes steps between vertices along edges; its available moves can depend on the current vertex.
For example, starting at zero, the steps produce the positions . This is one sample path; other step sequences can have the same endpoint. A simple random walk on the integer line makes this distinction particularly tangible: repeated Bernoulli trials determine both a whole sample path and an endpoint with a binomial distribution. All positions below are dimensionless quantities measured in steps of length one, and counts discrete updates.
The model is useful because it separates an average tendency from accumulated fluctuations. A fair simple symmetric random walk has zero expected value at every time, yet its standard deviation grows: cancellation across many possible sample paths does not keep each walker near zero. The two figures below compare sample paths with exact endpoint probabilities. For the basic additive construction and its independent increments, see MIT, Stochastic Processes I, section 2.
Rational arithmetic 2026-10-20
Exact arithmetic on rational numbers represented by integer numerators and nonzero integer denominators. Common factors can be removed with the greatest common divisor. Exact rational arithmetic avoids rounding error when deciding equality or integrality.
For every additive function , every real number , and every rational number , one has . This is the scalar multiplication part of being a linear map over the rational numbers.
First gives , and gives . Repeated addition gives for each positive integer , and the negative case follows from the sign identity. If with and , then
No continuity was used. In particular fixes , , and every other rational value, even for a discontinuous additive function.