Binary numeral system Created 2026-09-29 Updated 2026-10-20
The binary numeral system is positional notation with radix two. Each binary digit is zero or one, and its place value is a power of two. A one includes that weight in the sum; a zero skips it. The binary representation therefore selects and represents the integer .
To obtain those binary digits from , repeatedly use Euclidean division by two:
The remainders, in the order produced, are . Read them in reverse order to get . The final zero is the quotient that stops the conversion, not an additional leading binary digit. Starting with zero itself needs the special single-digit representation .
A useful independent check reads the binary digits from left to right. Start with and, for each binary digit , replace by . For , the intermediate values are . This reconstructs the integer without reversing a list and explains why appending a zero on the right doubles the value.
Binary is well suited to computation because each binary digit has just two possibilities. A stored bit can encode either possibility; groups of bits encode larger integers. Practical integer arithmetic can use a radix that is itself a power of two, grouping several binary digits into each stored numeral digit.[ref] A displayed negative integer, such as , uses a separate sign. A computer's particular signed storage convention is an additional encoding choice, so the displayed sign should not be confused with an extra binary place.
Binary partition Created 2026-10-20 Updated 2026-10-31
An integer partition in which every part is a power of two. Its generating function is , because the factor indexed by chooses the multiplicity of the part .
Binary powering multiplication count Created 2026-10-14 Updated 2026-10-24
For the optimized left-to-right exponentiation by squaring algorithm, let be the length of the binary expansion of a positive integer , and let be its Hamming weight, the number of digits equal to one. There are exactly digits after the leading one, and exactly remaining ones. Therefore the count is
Here counts squarings and counts further multiplications by the base; every squaring counts as one multiplication in . Assignment, digit reading, and any inversion are outside this count. The formula includes , which requires zero multiplications; define separately.
For a fixed length , the bounds are . A power of two reaches the lower bound because its Hamming weight is one; reaches the upper bound because all digits are one. For , and , giving . Thus the arithmetic operation count is in Big O notation, but inputs of similar magnitude can have different counts.
Figure 1.
Exact multiplication counts for optimized exponentiation by squaring depend on binary length and Hamming weight
. For positive exponents through , dots show , including each squaring. The dashed curves bound all counts at each binary length. Successive multiplication needs operations. The second panel compares squarings and further multiplications for exponents . These are exact counts, not timing measurements. Details.
This is a count for the specified algorithm, not a claim that it always minimizes multiplications among all methods. For instance, at the count is six, but the powers with exponents can be built in five multiplications: square, multiply by , square, square, then multiply by the already stored . Saving operations this way uses a different schedule and stored intermediate powers.
Divide-and-conquer combination cost Created 2026-10-18 Updated 2026-10-20
The combination cost is the work needed to reconstruct an answer from the returned smaller answers. In a time complexity calculation, also count partitioning the input, preparing arguments, and other work outside recursive calls. Write their total as for a size- call. For an ideal balanced divide-and-conquer algorithm making calls of size , the recurrence relation is
where is a fixed positive integer and is the base case cost. Take , a power of two, so the size becomes one after exactly divisions. This is a model of total sequential work: all smaller calls contribute, even if a machine could run some simultaneously.
At level , there are calls, each of size . Expanding the recurrence relation gives the exact identity
The first term counts the base cases; the sum stops before their level because describes work in nonterminal calls. This separates depth, number of calls, and local work. Merge sort has two smaller calls and a linear merge algorithm, giving in Big O notation. The MIT notes derive this by summing equal work across levels, and contrast it with the same two-way split followed by quadratic local work.[ref]
Figure 1.
The same halving tree can have linear or quadratic work at each call
. Original exact cost models with , two children per nonterminal call, and one unit per base case. For local work , every internal level costs 16 and the total is 80. For , internal levels cost 256, 128, 64, 32 and the total is 496. The tree shows instance sizes; the ledger counts work rather than execution order. Details.
For the first constructed model, set , and . Every internal level costs , while the leaves cost . Thus , giving . If the same split instead has , then the finite geometric series gives
so . The root alone already costs in this second model. Smaller arguments do not eliminate expensive reconstruction. These are stipulated operation counts, rather than measured running times or exact merge sort instruction counts.
Binary search has a different saving: after its comparison, only one half remains a candidate. With constant-cost indexed array access and comparisons, its worst-case time complexity satisfies an upper recurrence relation for , with . There is one continuing branch, rather than two. At most nonempty candidate ranges are inspected for . Copying the retained half into a fresh array on every step would add linear work at that step and lose this logarithmic bound. The shrinking range and its representation both matter.
Fermat number Created 2026-10-07 Updated 2026-10-13
A Fermat number is the positive integer , indexed by a nonnegative integer . The first five are , all prime numbers; the next is the composite number . This family offers a compact lesson in number theory: a very persuasive finite pattern can fail, while an exact divisibility relation settles a gigantic case with little computation.
Figure 1.
Exact Fermat numbers: five initial primes, a composite sixth term, and rapidly increasing decimal lengths
. Details.
Why does the exponent itself have the form ? Suppose is a positive integer with an odd integer factor . The polynomial factorization shows that is a proper divisor of . Consequently, if is a prime number, must be a power of two. That is a necessary condition, rather than a promise that the surviving candidates are prime.
The Fermat number product identity makes distinct Fermat numbers coprime integers. Thus every term has a prime factor absent from all earlier terms, whether or not that term is itself a prime number. This gives an explicit route to infinitely many different prime numbers, without establishing that infinitely many terms of this particular sequence are prime. Meanwhile the prime divisor of a Fermat number criterion filters possible factors through a small multiplicative order calculation.
The family also links arithmetic to Euclidean geometry: a constructible regular polygon can have a number of sides equal to a power of two times a product of distinct Fermat primes. The Gauss-Wantzel theorem gives the precise criterion. For instance, and qualify, but does not. The word "distinct" matters. Carl Pomerance describes this connection in Primality testing: then and now by Carl Pomerance (slide 18).
Historically, Leonhard Euler records Pierre de Fermat's proposed primality pattern, then refutes it by finding the factor of . His paper was presented in 1732 and published in 1738; those are different events, not competing dates for one publication.[ref]
A short modern check needs only two representations of :
In modular arithmetic these give and . Substitution yields , so . This verifies the factor directly; it does not claim to reconstruct Euler's search process.
If , the update satisfies because . For odd , starting with modulo and repeatedly doubling the number of correct bits computes its inverse modulo a power of two.
A straightedge and compass construction uses finitely many steps drawing lines through known points and circles with known centres and constructible radii, and adjoining their intersection points. The coordinates obtained by line–line intersections require only field operations; line–circle and circle–circle intersections require at most a quadratic extension after eliminating a linear equation. Thus all coordinates lie in a tower of quadratic extensions of the initial coordinate field. The degree of any finite intermediate coordinate field containing that initial field divides a power of two and is therefore for some .
For the source's notation this assumes , as is customary when previously constructed points are retained. If only the coordinates of a final subset are called , replace it by the compositum ; otherwise the expression need not be defined. The power-of-two condition is necessary and is not being asserted as sufficient for an arbitrary algebraic number.
Starting from a unit cube, doubling its volume would construct a length . Its polynomial is Eisenstein at two, so its degree over is three, which cannot divide a power of two. Thus doubling the cube is impossible by ruler and compass.
Set , . The real part of is . Replacing by gives
Choose the given angle to have cosine . It is constructible, since its unit circle point has coordinates . If a fifth of that angle were constructible and had cosine , the identity would imply
This polynomial is Eisenstein at five: all nonleading coefficients are divisible by five and the constant term is not divisible by 25, while 96 is not divisible by five. Hence . But the initial angle field is , itself of degree two, so adjoining any finite collection of constructible coordinates to it would still give total degree over a power of two. It could not contain a degree-five element. Thus general angle quintisection is impossible with straightedge and compass.
A constructible regular polygon can be translated, rotated, and rescaled by constructible operations to one inscribed in the unit circle with a vertex at . Thus the real and imaginary parts of are constructible. Part (c) puts both in a real field of degree over . Consequently , and because .
For prime , the supplied irreducibility of shows that . The intermediate-field tower law implies that divides . Every positive divisor of a power of two is a power of two, so
This necessary condition includes with . It does not assert sufficiency for arbitrary integers of this form.
The characteristic is the smallest positive integer with . Such an integer exists because the additive group is finite. If it factored as with , then with both factors nonzero, contradicting the absence of zero divisors. Hence it is prime. The elements generated by form a subfield isomorphic to . The finite set is a finite-dimensional vector space of some dimension over that subfield, so .
A nonzero polynomial of polynomial degree over a field has at most distinct roots. This follows by induction: a root gives a factor , and every different root must be a root of the remaining factor by cancellation. Thus has at most roots. In the finite multiplicative group, the elements whose order divides are exactly those satisfying . The supplied cyclicity criterion therefore proves that the multiplicative group is cyclic.
For the prime of the specified form write with odd. If , then is a proper factor of , impossible. Thus is a power of two. Since , the order of two divides but does not divide . All divisors of the power of two other than itself divide . Consequently
It generates the multiplicative group precisely when . For positive integers this holds exactly at : from onward , and the inequality persists on increasing . These give , equivalently the stated range among Fermat primes.
Apply comparator composition recursively in a balanced binary tree, with one-bit digital comparators at its leaves. For a power of two , the circuit size and circuit depth satisfy
There are leaves and internal nodes, so the circuit size is and the combinational delay is . Here each fixed-fan-in logic gate has bounded delay. For arbitrary , pad both inputs with leading zero bits to the next power of two, which is less than ; this preserves their unsigned interpretation and both bounds.
Pépin's test 2026-10-14
For , Pépin's test says that the Fermat number is a prime number exactly when the displayed modular congruence holds. Modular exponentiation evaluates it by exponentiation by squaring without constructing the enormous ordinary power. The index restriction excludes , where the base itself is divisible by the candidate.[ref]
For a proof outline of sufficiency, any prime factor of a passing candidate gives multiplicative order exactly , a power of two: its half-power is , rather than . Fermat's little theorem forces , so , and hence . Conversely, for a prime candidate, ; quadratic reciprocity and Euler's criterion give the required half-power. At , the check is .
Perfect number Created 2026-10-14 Updated 2026-10-14
A perfect number is a positive integer equal to the sum of all its positive proper divisors. The divisor itself is excluded: including it gives the equivalent condition for the sum-of-divisors function. The smallest examples are and .
For comparison, has proper divisors , whose sum is : it is a deficient number. The proper divisors of are , whose sum is : it is an abundant number. The proper-divisor sum classifies these examples with the same rule, and gives , so one is not a perfect number.
Figure 1. . Original exact proper-divisor sums for . Each bar is normalized by its candidate number, and its segments are labelled with the actual proper divisors. The dashed line at one marks equality with the candidate. These are finite arithmetic calculations, not empirical data. Details.
The interesting question is how such balances can be constructed without testing every smaller integer as a possible divisor. The Euclid-Euler theorem answers it for even integers: a Mersenne prime gives , and every even perfect number arises this way. For , this produces . The connection links divisor sums to primality testing for a particular family, while keeping the necessary hypotheses visible.[ref]
Euclid's Elements already gives the construction in Book IX, Proposition 36: add a succession of powers of two, and if their sum is prime, multiply by the final power of two. The modern finite geometric series makes the same pattern transparent. This original statement supplies the forward construction, rather than the converse classification of all even perfect numbers.[ref]
Power of two Created 2026-10-14 Updated 2026-10-20
In this positive integer context, a power of two is for a nonnegative integer , giving . Allowing negative or real exponents gives a broader meaning of exponentiation, which is not intended in the integer divisibility criteria here.
Prime divisor of a Fermat number Created 2026-10-07 Updated 2026-10-14
For a prime number , the exact criterion is
where must be different from two and is the multiplicative order of two modulo . If , then : the order divides but not , so it is exactly . Conversely, that order makes a square root of unity different from one in the prime field ; it must be , because has no other roots in a field.
Figure 1.
Exact modular powers distinguish Fermat divisors from the prime thirteen, whose multiplicative order is twelve
. Details.
For example, modulo seventeen the powers of two are . Their first return to one occurs after eight steps. The half-way value is , proving that . Likewise, identifies as a prime factor of . These are statements about divisibility, not evidence that the entire Fermat number is prime.
The multiplicative order always divides , by Fermat's little theorem, so . In particular, for every prime divisor of a Fermat number is one modulo four. That weaker modular congruence is insufficient: thirteen is one modulo four, but , which is not a power of two. It divides no Fermat number at any index. The exact order criterion explains the whole family, instead of testing finitely many terms.