The first term is , so the finite geometric series is . Subtracting cancels the interior terms and gives . Therefore
The rational expression holds for every real and every real , including ; the same algebra works for complex numbers. No restriction is needed for a finite geometric series. The exceptional case follows by adding one hundred equal terms, or by taking the limit as .
This is a finite geometric series with common ratio . Since ,
Thus .
For , use the finite geometric series with ratio :
The second equality follows by factoring in numerator and denominator. Taking real parts proves the finite trigonometric sum identity
When , every cosine is , so the sum is . This also gives the continuous limiting value at the excluded arguments.
Measure the work of producing the entire output list, with constant-cost labels. Count height in levels, so a leaf has height one and . A perfect ternary tree with levels has
vertices. This is the finite geometric series formula, used without a new proof.
The three recursive calls cost . Ordinary concat = foldr (++) [] copies each immediate child result once, and each result has elements. Consequently the nonrecursive work is , giving
Unroll this recurrence relation. At level , the cost is , and there are internal levels, followed by leaves. Therefore
For this is conventionally written ; in terms of total size it is . The extra height factor comes from copying labels at successive ancestors, even under lazy evaluation when the whole output is demanded. Merely producing its first constructor is a different cost question. If height instead counts edges, the source's height means levels; shifting the index by one leaves the boxed asymptotic bound unchanged. Part (c)'s suffix-passing implementation avoids this repeated copying.
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]
Perfect ternary tree 2026-10-31
A full ternary tree whose leaves all have the same depth. At depth there are vertices, so a tree with levels has vertices and leaves, by the finite geometric series formula. For a rose tree representation, recursively flattening children and joining their lists with ordinary list concatenation copies each label once per ancestor. The work is therefore when the complete output is demanded. Passing an already constructed suffix through the recursion instead emits each label once, giving work.
Positional notation Created 2026-09-29 Updated 2026-10-14
In positional notation, a numeral digit contributes its value multiplied by a weight determined by its position. Fix an integer radix . A finite string of numeral digits , with , represents the nonnegative integer
The rightmost position has weight ; each move left multiplies the weight by . This weight is the place value. For a nonzero integer, the canonical string has . Zero is written with the single numeral digit . Leading zeros are permitted in a fixed-width display but omitted in the canonical form: . A negative integer is written with a separate minus sign and the positional notation for its absolute value; the minus sign is not a numeral digit.[ref]
For example,
The zero is essential inside this string: , not . It records that the tens position contributes nothing while keeping the hundreds and units in their proper positions. The same integer has binary representation
Figure 1.
One integer, two encodings:
. Each numeral digit is multiplied by its place value. Decimal uses the weights ; binary uses . Zero digits preserve positions without contributing to the total. Both rows sum to . Details.
Repeated Euclidean division constructs the representation exactly. Set . At each step write
Keep the remainder and continue with the integer quotient . A positive quotient strictly decreases, so eventually it is zero. Substituting the successive equations back into the first gives : the numeral digits are obtained from right to left. The remainder modulo uniquely fixes , and then the quotient uniquely fixes the remaining string by the same reasoning. This proves existence and uniqueness once leading zeros are excluded. The needed unique quotient and remainder are precisely the conclusion of the Euclidean division theorem.[ref]
This finite expansion concerns nonnegative integers. Extending positional notation to fractional positions uses weights to the right of a point; an arbitrary real number need not have a finite digit string. In particular, the decimal representation represents , while the base-two string represents . The radix is part of the interpretation.
The benefit is compact arithmetic: positions can encode every nonnegative integer below . To see the upper endpoint, fill all positions with ; the finite geometric series gives . Carrying in addition exchanges units of one place value for one unit of the next. Thus a short string stores a large count and also supplies an algorithm for computing with it.
Quadratic exponential sum Created 2026-10-07 Updated 2026-10-14
A quadratic exponential sum has a polynomial phase of degree two. Its multiplicative derivative at lag has the linear phase up to a constant factor. This degree reduction lets the Van der Corput inequality for finite scalar sequences reduce its size to estimates for finite geometric series.
Repdigit Created 2026-10-14 Updated 2026-10-20
A repdigit is a positive integer whose base- expansion repeats one nonzero digit . For , and , the finite geometric series gives . For example, has decimal digits, all equal to five.
Every prime number not dividing divides infinitely many such repdigits. If it divides , every length works. Otherwise, if it does not divide , the Fermat little theorem gives divisibility for lengths that are multiples of , and division by is justified by its modular inverse. If , the sum is congruent to modulo , so lengths divisible by work instead. A prime dividing but not divides none, since . This distinction prevents invalid cancellation of the geometric-sum denominator.
Sum-of-divisors function Created 2026-10-03 Updated 2026-10-20
The sum-of-divisors function adds all positive integer divisors of a positive integer, including the number itself:
It is the divisor sum of the identity arithmetic function , so under Dirichlet convolution. Both factors are multiplicative functions, hence so is the sum-of-divisors function. The notation distinguishes it from other weighted divisor sums. [ref]
For a prime number and a nonnegative exponent , the positive integer divisors of the prime power are precisely . Their finite geometric series gives
For example, . For a prime factorization with distinct prime numbers and positive exponents , multiplicativity gives
For , this is an empty product, equal to . [ref]
The distributive property makes the formula especially beautiful: choosing one term from each factor produces each positive integer divisor exactly once, by the fundamental theorem of arithmetic. For , the choices form a three-by-two grid with entries , where and . Adding its rows gives
The divisor function counts six cells; the sum-of-divisors function adds their six values. Once the prime factorization is known, the product formula avoids testing every candidate integer divisor. Shared prime factors require care: , so the sum-of-divisors function is not a completely multiplicative function.
Figure 1.
The sum-of-divisors function for : each grid entry is a positive integer divisor, and the weighted total is
. Details.
Subtracting the number itself gives the proper-divisor sum . Comparing with distinguishes perfect numbers, deficient numbers, and abundant numbers. For , ; for , . Both are perfect numbers. The calculation makes a deficient number, while makes an abundant number. These comparisons turn the sizes of integer divisors into a classification of positive integers. [ref]
Figure 2.
The proper-divisor sum for : perfect numbers lie on , deficient numbers below it, and abundant numbers above it
. Details.
This connection is ancient: Euclid's Elements, Book IX, Proposition 36, constructs a perfect number by multiplying the last term of by their sum, when that sum is a prime number. In modern notation, put and , with and a prime number. The sum-of-divisors function proves the construction immediately:
Consequently the proper-divisor sum is . Taking produces the perfect numbers . [ref]
Fix . There is no injective function from all length- binary strings to binary strings of length strictly less than . There are possible inputs, but even allowing the empty string gives only
possible shorter outputs. The finite geometric series and pigeonhole principle leave at least two inputs sharing an output, which prevents exact decoding. For , eight inputs compete for the empty string and the six strings 0, 1, 00, 01, 10, 11.
This counting argument includes any file header or other information sent to the decoder. An algorithm chosen separately for each input must also be identified to the receiver; its description is not free. A useful compressor saves space on some inputs while leaving others unchanged or making them longer. Lossy compression avoids the exact-recovery requirement by deliberately allowing several inputs to share an output.