Digit-Collision Energy and the Common Reset
Cite this paper
A. S. Petty, Digit-Collision Energy and the Common Reset, DOI: 10.5281/zenodo.24602180.
Abstract
For an odd prime , the first dilates of the sawtooth all jump at zero. With midpoint values at the jumps, the continuous mean square of their sum is the Franel–Landau GCD sum . A permutation of the division points identifies the sampled field values with the excesses of carries at equal-digit positions in base . The sum of their squares is the digit-collision energy . We prove Restoring the one-sided value of the square at zero adds exactly to the grid mean. The remaining error tends to zero even as both mean squares grow like . For the interior jumps we bound a signed double sum of Dedekind sums by . Keeping the second term of the GCD sum then gives The unit correction also gives the discrepancy of a weighted second moment of over the primitive odd characters modulo , relative to the same GCD sum.
The common reset and the carry table
Every one of the first sawtooth waves jumps at zero. Their sum has midpoint value zero there, and its square approaches from either side. In the integral the value at that point costs nothing. On the grid of points its weight is . The common jump alone therefore accounts for nearly one unit of mean square. Meanwhile, every reduced fraction with denominator below is a jump of at least one wave. Can correcting a single squared sample recover the integral to an error tending to zero when the number of waves grows with the grid?
For an odd prime their signed contribution reduces, up to an explicit curvature term, to a double sum of classical Dedekind sums. Writing for the inverse modulo and taking , the estimate we need is Theorem 28 proves it. After division by the number of samples, this bound leaves the common jump as the entire limiting defect.
The same grid arises from a carry count. A digit collision occurs where the two digits of a word agree. In base five these words are . They occupy one fifth of the table, yet a walk can put more or fewer than one fifth of its carries there. Opposite increments give opposite excesses (Proposition 5), so the signed excesses sum to zero. Squaring each excess before summing retains the size of every surplus and shortfall. We call this total the digit-collision energy.
For an odd prime , only primitive odd characters modulo contribute to the carry field. Proposition 7 expresses the digit-collision energy as an explicit multiple of their weighted second moment of . Zhang [21] studied the corresponding moment over all nonprincipal characters, with weight . Shparlinski [16] extended the range to include , . Zhang’s earlier identity for a single Dedekind sum [20] gives another derivation of the moment formula. By bounding the signed contribution of all the interior jumps together, we prove that restoring the squared sample at zero brings the grid mean within of the continuous mean square (Theorem 2).
For an integer base , the equal-digit positions are For , define Each difference of floors is zero or one. Arrival at an integer counts as a crossing. This convention fixes the value at every boundary. Over all steps the floor differences telescope to . The marked words account for a proportion of the steps, giving the allowance even when the walk revisits a position.
The corresponding field on the circle is built from the centered sawtooth where . The th wave has period . We call each jump a reset. The origin is the common reset of all waves. For positive integers , put We call the sampling defect, taking the integral minus the grid mean. The permutation in Proposition 5 identifies each signed carry excess with a sample of . Thus is the mean square of this field on the grid points, and is its mean square over the whole period. Subtracting the grid mean from the period mean gives . In base five the squared excesses sum to . Their mean over the increments is , while the same four sawtooths have mean square over a full period. The difference between the two means is .
Theorem 1 (Cubic law and its secondary term). As tends to infinity through odd primes,
The continuous energy is the classical GCD quadratic form Its leading estimate follows from Hilberdink, Luca and Tóth [9]. Section 3 retains the fractional-floor contribution and obtains To transfer that coefficient to the finite table, the sampling error must be smaller than . The following estimate resolves the discrepancy on the finer, absolute scale.
Theorem 2 (Unit sampling defect). Let . For every , as tends to infinity through odd primes, Equivalently, The implied constants depend only on .
On the prime-square grid each individual wave misses only of its continuous mean square. Even after adding such deficits one obtains a quantity tending to zero. The secondary coefficient in Theorem 1 and the limiting unit in Theorem 2 both come from products of distinct waves (Proposition 29 and Corollary 30).
As the prime increases, the grid is refined and the field gains new waves. The first comparison is available on every integer grid (Proposition 12). The Dedekind representation in Proposition 14 requires the grid size to be coprime to the indices. The all-prime bound takes the cutoff and the grid together. In particular every inverse frequency below is a unit modulo .
The notation denotes the greatest common divisor, the Möbius function and the number of positive divisors of . We write for real and , with . All logarithms are natural. The symbols and have their usual uniform meaning. Subscripts indicate allowed dependence of the implied constant.
Sawtooth sums for the carry table
The nine two-digit words in base three occupy a circle in numerical order. The steps of a walk are numbered from to . Steps are marked because their words are . With increment one the only carry comes on step , when the walk returns to zero. The three marked steps have one carry against a proportional share of , an excess of . With increment eight, step starts at . The same marked steps now start at . Two of them carry, against a share of . The two excesses have opposite signs, but each contributes when squared.
Table 1 displays all nine readings in base three. The three carry rows correspond to the selected words. Their sum is , and the last row subtracts the allowance. Thus .
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | |
| 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |
| 0 | 1 | 2 | 1 | 2 | 1 | 2 | 1 | 2 | |
A pair of base- digits specifies an interval of width . Counting remainders in the equal-digit intervals of long division gives the floor differences in the carry table. Once those counts are known, a change of address makes every centered count a value of the same sawtooth sum. Write and let denote the least nonnegative residue modulo .
Equal successive digits
In the base- expansion of , with prime and , the first digit is . Long division gives as the next remainder, so two successive digits agree precisely when . Replacing in the remainder update by any unit gives a related question. For which multipliers must the two digits differ at every remainder?
Proposition 3 (Collision-free multipliers). Exactly multipliers give for every . They are for .
Proof. Write . Euclidean division gives . Since and the digit lies between and , the residue of modulo determines the digit. As runs through the nonzero remainders, so does . A collision therefore occurs exactly when and have the same residue modulo .
Let count these collisions. For , write . The displacement is a nonzero multiple and . For put . Since and , we have . The two possible pairs are Both lie in precisely when . The displacement recovers . Summing the two contributions at each gives If , then throughout this range, and the count is zero. If , the displacement already gives two collisions. The value would give . For , every remainder gives a collision. The values give distinct multipliers . ◻
The number of collision-free multipliers is independent of . Long division uses the particular multiplier . For this multiplier the excess count is the field of (2), even for a composite denominator coprime to .
Proposition 4 (Successive equal digits). Write with and . Among , the number whose first two base- digits in coincide is
Proof. The integer has the first two digits of as its base- digits, including a leading zero when needed. Both digits are precisely on for . With included, the number in that interval is . All interior endpoints are nonintegral in units of . The ceiling count exceeds the floor difference by one at and falls short by one at . Both intervals are marked. Their corrections cancel. Substituting leaves from each of the intervals and from the remaining floor differences. Removing the remainder zero gives the stated count. ◻
Straightening the carry table
Multiplying an increment by permutes all addresses. Its inverse is modulo , since their product is . At the new address the floor differences in the marked count reduce to a sum of sawtooth values. This identifies the field value even for an increment that revisits positions during its walk.
Proposition 5 (Straightening identity for the carry table). For every integer ,
Proof. Each floor is its argument minus its fractional part. The linear terms cancel the centering . Since , substitution of gives two fractional-part sums with indices and . Their difference is The equality includes integer arguments. The multiplier is a unit modulo , with inverse , proving the energy identity. ◻
The continuous comparison comes from the pairwise integral of two sawtooth waves. Franel stated the identity and Landau proved it [1].
Proposition 6 (Franel–Landau sawtooth identity). For every positive integer ,
Proof. The nonzero Fourier coefficients of are . The common frequencies of and are the multiples of their least common multiple. Parseval gives In the expansion of , each ordered pair contributes four times this integral. Their sum gives the formula. ◻
Thus every pair of clocks contributes through its gcd overlap. Primality enters later, when the sampling grid must be coprime to every interior reset denominator.
Primitive odd characters
At an odd prime the field vanishes on every multiple of in the address table. For with , the waves run once through the nonzero residues modulo , whose sawtooth values cancel in pairs. At each wave vanishes separately. We can therefore expand the entire energy in characters of the unit group. Oddness removes the even characters. A complete sum over the nonzero residues modulo removes the induced odd characters as well.
Put , , and . Extend each character modulo by zero on the nonunits, and set A primitive character here means one that does not factor through reduction modulo . A star below restricts the sum to primitive characters satisfying .
Proposition 7 (Prime-square character energy). Only primitive odd characters can contribute, and on them Consequently
Proof. Under the substitution , the field in the transform is the sawtooth sum of Proposition 5. Oddness of removes every even character. For an odd character, substituting into each inner sum gives . An odd character induced from modulo has . Character orthogonality on gives the first energy formula.
For the last formula put . Replacing by in the exponent multiplies this sum by for a unit . For the exponential is constant on each fibre modulo , where primitivity makes the character sum zero. Finite Parseval on now gives . At every in the sum the sine series converges. Oddness turns the finite sum of the sines against into . Hence , where . Substitution gives the stated factor. ◻
Zhang’s earlier identity for a single Dedekind sum [20] gives a second derivation of the moment from the ordered pairs in (45). For each divisor of , summing over gives for characters modulo . Odd characters modulo and their lifts have . The surviving term at has coefficient for . The field calculation above also retains the phase of each coefficient.
For the full nonprincipal moment, Shparlinski’s error bound contains , where counts the distinct prime divisors. Put . Relative to , the primitive odd moment has correction by Theorem 2. The error in the full-family estimate allows a term of this size. Here the even characters have zero field coefficient. Walum [18] gives an exact unweighted mean square. For mean squares of odd -values and their relation to Dedekind sums, see Louboutin and Munsch [12].
The integer threshold used in counting base- blocks gives the same energy after a class correction. For , , put and . Then Indeed . Each residue class modulo has zero sum of : its indicator on is a linear combination of characters induced from modulo , all of which have zero coefficient. The cross term thus vanishes, and . Also , giving the second identity.
The second term of the GCD sum
With ten waves, the reduced pair occurs three times, as , and . All three pairs contribute the same integral. More generally, a reduced pair with larger index occurs times. Replacing this count by overcounts the pair by the fractional part of .
Hilberdink, Luca and Tóth [9] give . To determine the coefficient on that logarithmic scale, we keep the fractional part of every count and sum it with the weight of its reduced pair. The estimate for these fractional parts comes from Saffari and Vaughan, who adapt a theorem of Walfisz in their proof [15].
Put
Lemma 8 (The deficit in the continuous mean square). For every positive integer , The first term is .
Proof. After multiplying (8) by three, the diagonal contributes . For an off-diagonal pair, divide by its gcd and call the larger reduced coordinate , the smaller . The two orders and the scales give Möbius inversion and the classical Euler sum [6] give All these sums converge absolutely. Insert and complete the sum to obtain (9). The tail estimate follows from . ◻
Saffari and Vaughan’s Theorem 6 [15] gives the logarithmically weighted distribution for . Its error has an absolute implied constant, uniform in . The GCD sum uses its first moment (12). In our notation the distribution estimate is
Lemma 9 (Weighted fractional parts). For real ,
Proof. Integrate (10) in . Since one first obtains Since , rearrangement gives, uniformly for , Partial summation gives Finally, . The constant term contributes by (12), and the final error is . ◻
Theorem 10 (Secondary term of the GCD sum). As ,
Proof. Write for the fractional-part sum in (9). Möbius inversion gives For , Lemma 9 bounds each error. Their absolute values are summed with the weights in the last display. For , the defining sum is , so contributes . Therefore Extending the main sum from to costs . The last equality uses absolute convergence of ; the linear and constant logarithmic moments are absorbed by the stated error. Equation (9) now gives The coefficient follows from . ◻
Corollary 11 (Square and triangular GCD/LCM sums). Writing for the least common multiple, we have
Proof. The square sum is by Proposition 6, since . Symmetry makes the triangular sum one half of the square sum plus one half of its diagonal . Apply Theorem 10. ◻
The square-box formula identifies the coefficient in the error of the earlier leading estimate. To carry it back to the digits we must compare the integral of the squared waves with their mean on the original grid.
Sampling at rational resets
Of the four waves in base five, only the third jumps at . The other three have values , so the midpoint field at the jump is . The grid of twenty-five points misses , yet the position of this jump between two samples affects the error. At zero the grid hits the jump, and all four waves reset together.
Independent coefficients in the two factors of the square distinguish the wave that jumps in the first factor from the value of the second factor at the same point. The following form of Huxley’s weighted Farey identity [10] also counts the jumps that fall on the grid.
For real coefficient vectors of length , put and let be . Write for and set The waves with reset at each reduced fraction .
Proposition 12 (Bilinear sampling identity). For all the signed discrepancy is Here counts the origin.
Proof. At , write and , with the analogous notation for . The left and right values of are and , and its slope between resets is . For the right value minus the left value and the corresponding jump of its ordinary derivative are The mean of the one-sided products is . An actual grid value uses . This contributes to the discrepancy precisely when .
For , twice differentiating distributionally gives The remaining ordinary second derivative is constant on the circle away from the finitely many resets, so has zero th coefficient. In the grid average of the Fourier series, taken in symmetric Abel limits, only the frequencies divisible by remain. The two series of coefficients and give and . Subtracting the point corrections just calculated gives All jump sums are finite. For each wave the residues run through a grid of size with multiplicity . Summing the quadratic over this grid gives . With these two jump contributions, the negative of (17) gives the stated discrepancy. ◻
For the original equal weights put , , and define Complete residue periods have zero midpoint sum, so . At precisely waves jump. The factor is what the other waves contribute at that point, and records where the reset lies between grid points.
Corollary 13 (Sampling on a coprime grid). If for , then
Proof. With in (15), only the origin belongs to both the grid and the reset set. Here , and . ◻
For an odd prime , the carry table has and . With its discrepancy is The reset term tends to one and the curvature term is . To obtain the sampling theorem, it remains to bound the signed sum over the interior resets. Figure 1 shows the point correction at base five.
For the interior estimate, use the classical Dedekind sum [2] It is periodic and odd in . A bar denotes the multiplicative inverse modulo the denominator in use.
Proposition 14 (Dedekind representation). If for every , All numerator indices occur, including nonunits.
Proof. Complete periods of sum to zero, so the prefix in the definition of has the same sum as . The multiplicity counts the multiples of through . Collecting the reduced fractions on each larger grid gives Changing variable to turns the inner sum into . ◻
The ratio on the square grid
The pair gives a signed term in the defect that we can follow at every prime . The square is one modulo both denominators, so the contribution of this pair can be calculated for all its common multiples at once. The two orders contribute the sum Grouping (20) by the common factor of its indices gives Indeed , by summing the first sawtooth over the lifts of each residue modulo . The second sawtooth is constant on those lifts. Diagonal terms vanish. For every prime the square is one modulo six. Thus , and all the common multiples of the fifth contribute .
At the fifth lies on the line . On the entire line, and . The substitution of a unit times the summation index gives . Classical reciprocity [2] now gives Every pair on this line is primitive and has multiplier one. Summing over both orders gives , using . More generally the same reciprocity calculation holds whenever . On this family . For a fixed , each divides the nonzero integer . Including the original multiplicities bounds the sum of absolute contributions by .
The digit-alignment count in [13] gives a simple comparison for the same ratio. Among cells, , mark those numbered or modulo . Removing the marked point zero and distributing equal weight over the remaining points changes the marked proportion by For prime and , shifting by base- digits leaves . The factor is a unit modulo . Classes and thus give the terminating tail and the tail of the reference numerator , respectively. At the ratio of these deficits is whenever both denominators have the required support. In base twelve, , , gives the limit .
Multiples on either side of the square
At the interval of length just below contains two multiples of . The interval just above it contains one. For the counts reverse (Figure 2). The side containing the extra multiple determines the sign of the surviving term from this pair of residue classes.
For and , the interval consists of . At each such , the terms with in (20) have source readings . The first full cycle of contains one of each, with sum zero. The last terms form a prefix of length less than . Put . Let be one if and zero otherwise, and let be one if and zero otherwise. The surviving weights, with the factor two from (20), are and , where summing the squares in gives .
Proposition 15. For either sign, as tends to infinity through primes,
Proof. Since , the count in is . The count in is . A central is coprime to and lies strictly between and for large . It cannot divide , so the upper interval extends to with the same count. In particular Writing , the two individual counts after subtracting one are respectively Their common weighted mean is For each of the three numerators , Lemma 3.4 of [11] gives on every subinterval of . Its hypotheses hold with and lower dyadic endpoint , since . Partial summation against costs . ◻
The remaining coprime readings make both signs larger still. After the complete cycle on each central row has canceled, put where . These are the two sign masses of the same part of the original table, in the row order of (20).
Proposition 16. Both and have order .
Proof. Let . For coprime , use the central denominators coprime to . The two residues are distinct across all these reduced fractions on each such row, since . Rademacher’s three-term reciprocity law [14, 8] gives Thus uniformly for large , using . Write . If , this positive reading lies in the prefix. If , its negative lies there. These inclusions use .
Each window occurs times on each reduced class , uniformly in . To see this, inverse reciprocity gives , with the second term constant on the class (zero for ). On each window the triangular tent of height one, zero off the window, has area . A real trigonometric polynomial approximates the tent uniformly within . Subtracting gives a minorant of the indicator with mean at least . Both polynomials are fixed before are chosen. For each of their finitely many nonzero frequencies , the phase has second derivative of size in the progression index. The second derivative estimate [7] bounds the exponential sum on the class by . The constant term contributes . Dividing the error by gives since .
Each sign therefore has mass . This sum is asymptotic to . Indeed, give each of the independent weight at . At a prime , the factor is zero if both are divisible, if exactly one is divisible, and one otherwise. For any finite set of primes the harmonic weights become uniform on residue classes, giving the indicated product of means. The omitted primes change the mean by at most , since the probability of divisibility by is at most . The product is positive. Finally the absolute first moment [4] bounds both masses from above on summing over . ◻
After division by , each sign on these rows still grows. The sampling identity adds the two signs together with every remaining row and numerator. It is that complete signed sum which the following sections estimate.
Dedekind sums by additive order
On the six-point grid a frequency of turns per step completes a turn in three steps. The same frequency occurs at moduli and every further multiple of three. In general the denominator of the reduced frequency is its additive order, which we call its conductor. We group the terms in the Dedekind sums by this order.
The numerator at each multiple runs from to the same endpoint . At conductor the kernel is odd, so every complete period cancels. Only the last terms remain, however many multiples of occur in the original sum. The multiples still determine the weight of that last interval. Throughout, a bar denotes a modular inverse at the indicated modulus, is the Möbius function and counts positive divisors.
Write and define for , with value zero for . The conductor kernel will be denoted by , to distinguish it from the carry count .
Lemma 17 (Exact-order kernel). For every integer and every integer , where . Consequently, The kernel is odd in and has zero sum over a complete period.
Proof. The finite Fourier transform of the integer-zero sawtooth is It follows by differentiating the finite geometric sum, or directly by summing at a nontrivial -th root of unity. Fourier inversion in one factor of gives This computation permits nonunit . Group the terms according to , writing with . The resulting sum is (23) with the cotangent kernel in (22). Divisor Möbius inversion gives its first expression. Oddness follows from the sawtooth definition. For each unit , multiplication by permutes the residues, whose odd cotangent sum is zero. This proves the complete-period assertion. ◻
Assume throughout this section that for . Put and .
Proposition 18 (Harmonic weight of a conductor). The entire interior source is
Proof. After substitution of (23) into (20), each original modulus has the form and contributes the factor . The numerator sum is through the same for every lift. Complete periods of cancel, leaving the prefix . Summing over gives . Every sum is finite and every original modulus is retained. ◻
For a residue modulo , represented in , define This signed pair of endpoint indicators is odd. It records the prefix and its reflection together, including equality at either endpoint.
Proposition 19 (Fourier expansion of the signed cutoff). For , , put Then Completing the endpoint frequency gives Only is restricted to units. All nonunit and are included.
Proof. Oddness replaces twice the prefix in (24) by a full period weighted by . Insert the cotangent expression (22) and change variable to . This gives the double sum over all nonzero , with factor . Each of the four sign choices has the same product. Restricting to therefore gives (28). The zero and half-period cotangent terms vanish.
The normalized finite Fourier coefficients of the endpoint indicator are and its mean is zero. Pairing with in Fourier inversion introduces times the corresponding sine factor. The half-period coefficient, when present, is zero. Finally , so the two signs cancel in the product of sines. This proves (26), with the literal endpoints and . ◻
In the triple sum, enters the last sine linearly, enters through its inverse modulo , and comes from the cutoff at the end of the numerator interval. We shall truncate and . The sum over will run over its full range.
Small conductors
For the original carry table let be an odd prime, and . Write , and . After the complete periods cancel, one prefix remains at each conductor. Through , summing the absolute bounds for these prefixes costs . At the larger conductors we shall need the signs.
The elementary inequality for gives Since each permutes the residues, (22) implies Oddness makes the total positive and negative masses equal. Any prefix, including one permuted by , is therefore bounded by half the total absolute mass. Put . Multiplying by and summing through gives This includes every frequency at those conductors.
Bounds for the Fourier tails
In the sum over , a phase increment close to an integer number of turns can give a large geometric sum. How often can this happen as the conductor varies? Fixing the residue of the increment restricts the conductor to divisors of one integer. The same argument applies to once we expand the two sine factors that record the endpoint. This lets us bound both tails while keeping every inverse frequency .
The linear phase
For fixed and , the phase in the sum over advances by turns per step. Write for the centered residue of modulo . When is small, consecutive terms turn slowly and the geometric bound weakens. For fixed , however, every eligible divides . The choice makes this integer positive, so its divisor count bounds the number of such moduli.
Write , so that for every .
Lemma 20 (Nonzero determinant count). Let and . For every , , let be the centered residue of . Then if , and For fixed there are at most possible . Also, for ,
Proof. The congruence follows from . Since and are units, zero would imply , impossible for . Also while , proving the strict lower bound. The upper bound follows from . The last estimate follows by splitting at , or by the harmonic sum. No zero determinant is charged as a divisor. ◻
Proposition 21 (Linear-frequency tail). For , the part of (26) with has magnitude . The same bound holds if or is restricted to any initial interval, and if the moduli are restricted to any subset.
Proof. Split into dyadic intervals of scale . For fixed , the coefficient outside has magnitude . On the retained interval the cotangent is positive decreasing, with sup norm plus variation . The geometric-sum estimate and summation by parts therefore give The cutoff can shorten the last interval. In summing over we bound by . All terms of the bound are positive, so the sums over and may be interchanged. By Lemma 20 with , each fixed occurs for at most moduli. Thus the block cost is at most The dyadic sum of is , proving the proposition. ◻
The three endpoint phases
The two endpoint factors contain and . Expanding their product leaves the original linear phase in and two shifted phases. The shifts are in the phase numerator. Doubling that numerator gives an odd integer in the shifted cases, so the geometric sum never encounters a zero residue there.
Proposition 22 (Endpoint-frequency tail). For , the part of (26) with has magnitude . The same estimate holds after initial-interval restrictions on and arbitrary modulus selection.
Proof. The product-to-sum identity gives the amplitudes On a dyadic interval of scale , the positive cotangent and cosecant factors decrease. Their sup norms plus variations in are . The phases are , with Let be the centered residue of modulo . It is nonzero. For this follows from , and for it is odd. The geometric bound for a block is up to an absolute constant. For fixed , every contributing modulus satisfies Moreover . Here , , so . The upper bound follows from . Each such modulus is a divisor of this fixed nonzero integer. Sum over , use the harmonic bound corresponding to (31), and sum and . The resulting block cost is . Summing the dyadic blocks proves the claim. All three phases were included. ◻
Completion of the reciprocal sums
Even at fixed frequencies the conductor varies. The inverse of modulo changes with it, which makes cancellation across consecutive hard to see. Reciprocity gives a periodic factor depending only on and a smooth phase proportional to . Expanding the periodic factor in its finite Fourier series leaves linear twists of that same smooth phase.
Twists with derivative near an integer
When the derivative of a phase is close to an integer, successive terms of its exponential sum can point in nearly the same direction. The twist indexed by shifts the derivative by . Since these shifts are equally spaced, the range of the derivative bounds the number of twists that need the second-derivative estimate. For the others the distance to the nearest integer gives a first-derivative bound.
For a compact interval , put Here the distance is the usual distance on the circle, or equivalently the infimum of ordinary distances to all integer translates.
Lemma 23 (Grid distances). If is an integer and has length , then
Proof. Enlarge the arc by at either end. If this covers the circle, the first bound is immediate. Otherwise an arc of length contains at most grid points, with one additional point allowed to cover every endpoint convention.
Outside the enlarged arc, group distances into , . Each group lies in at most two arcs of length , one at each end of . Allowing both boundary points gives at most four grid points per group. Distances on the circle are at most , so summing through proves the bound. ◻
We use two classical derivative estimates. If a real phase has monotone derivative a distance at least from the integers, its exponential sum is . If on an interval containing consecutive integers, the sum is . See Graham and Kolesnik [7]. The estimates include arbitrary subintervals. A negative second derivative is handled by complex conjugation.
Lemma 24 (Sum of linear twists). Let contain consecutive integers, taking to be its first and last integers. Suppose is twice continuously differentiable and on , where . Then, for every integer , The same conclusion holds for negative second derivative with the corresponding absolute bounds.
Proof. The case follows from the last term. Otherwise let , so If , apply the second-derivative bound to all twists. Its contribution is at most , giving (34).
For the negative derivative ranges over . For the modes with the second-derivative bound suffices. Their contributions total at most . By Lemma 23, their other contributions total at most For every remaining mode the derivative stays between two consecutive integers, at distance at least . The first-derivative estimate and (33) give for their sum. This proves the claim. Conjugation and reindexing prove the negative case. All estimates are uniform on subintervals. ◻
The complete Kloosterman sum enters through the bound of Weil [19] in the general-modulus form of Estermann [5].
Proposition 25 (Completed reciprocal phase). Let , , and assume the hypotheses of Lemma 24. Then, for every , For interpret the periodic factor as one. The same bound holds.
Proof. The function is periodic modulo . Its normalized Fourier coefficients are The classical complete Kloosterman estimate gives, for every , For positive numerator indices this is the bound stated by Bettin and Chandee [3]. Periodicity covers every nonzero residue. If one index is zero, the sum is a Ramanujan sum with magnitude at most the gcd of the other index and , which satisfies the same bound. If both are zero, . Thus the estimate also includes zero modes and composite moduli. Fourier inversion is exact on the whole conductor interval, even across many periods. Lemma 24 bounds the sum over the linear twists. The uniform coefficient bound supplies the remaining factor. For the sole Fourier coefficient is one, and the derivative estimates also apply directly. ◻
Conductors with the same quotient
As varies, the weight is constant until the quotient changes. On an interval with quotient , the second derivative of the reciprocal phase has size , with absolute comparison constants. It lets us sum the linear-twist bounds over all inverse frequencies on that interval.
Put and . For fixed , let denote the sum of over the integers where is any interval. Empty ranges contribute zero.
Lemma 26 (Band estimate from slope separation). For and every admissible , The estimate is uniform in the interval and in all half-range cuts.
Proof. The exact product-to-sum expansion has amplitudes and sine phases , where and . Inverse reciprocity gives the exact identity For the first factor on the right is one. Since and , all three coefficients obey .
Set . The interval lies in and . For , the scale gives and The number of consecutive integers in any permitted conductor interval is at most . Indeed implies , so the extra endpoint is absorbed. All constants are absolute for sufficiently large . The finitely many smaller primes are harmless.
Proposition 25, including its uniform subinterval form, therefore bounds the phase sum by Here gives , and divisor and logarithmic factors are absorbed into .
Each absolute amplitude is increasing on the permitted range. This follows from the increasing factors , , and . Its supremum plus variation on any retained interval is . Partial summation with (40), followed by summing the three original phases, proves (37). ◻
Proposition 27 (Sum over all inverse frequencies). For , the part of the exact source with , , , and every permitted inverse frequency has magnitude The same bound holds with an additional interval restriction on and on the conductors within each quotient band.
Proof. For and , divisor expansion gives Indeed . With the two estimates follow from the harmonic sum and . The divisor factor is at most , hence for .
In the sum of (37) over and then over , each band retains its original harmonic weight . The first term costs using and the analogous bound for . The second term costs because and converge. The third costs Since the last sum is , reducing preliminary epsilons absorbs these logarithms. Convergence of the two other harmonic-lift sums follows from . Initial frequency restrictions, nonunit products, partial intervals and the full contribution have all been included. Positive majorants also permit the stated additional interval restrictions. ◻
The quarter-power bound for the sampling defect
Raising the cutoff in either frequency shortens its tail and enlarges the sum left to estimate. For a common cutoff the bounds vary in opposite directions. Up to factors , each tail is bounded by and the remaining sum by . They meet at . The factor in the grid mean then gives the quarter-power error.
Table 2 records the disjoint ranges. Here and . Every permitted inverse frequency is retained in every row. A common factor absorbs divisor factors and fixed powers of logarithms.
| Range | Bound, apart from | Estimate |
|---|---|---|
| (30) | ||
| Proposition 21 | ||
| Proposition 22 | ||
| Proposition 27 |
Theorem 28 (Bound for the signed sum over interior resets). Uniformly for and every , Consequently,
Proof. Retain all frequencies at and use (30). At larger , partition the remaining triples into ; then ; and . Every inverse frequency remains in each part. Propositions 21 and 22 apply with exactly these interval restrictions. Proposition 27 bounds the last part. There are no overlaps or omitted ranges. Choosing preliminary epsilons smaller absorbs divisor factors and fixed powers of logarithms, proving (43).
At , the box and both tails have order , and the small-conductor cost is smaller. The ceilings change only absolute constants. The finitely many smaller primes are absorbed into the constant. This proves (44). ◻
Proof of Theorem 2. Equation (19) gives The first term satisfies the bound of Theorem 28. The three explicit corrections together contribute , smaller than the asserted error. Multiplication by gives (6). ◻
Thus restoring the squared value at zero leaves an error tending to zero in absolute size. The comparison is with the integral of the same waves for each . Their integral itself grows with .
The cubic law and its second term
In the carry table the continuous energy is multiplied by the number of entries . This gives a leading term of order and a correction of order . On the same scale, replacing the integral by the grid mean costs only order . Thus the finite count inherits the coefficient of the squared logarithm.
Proof of Theorem 1. Theorem 10 and Theorem 2 give For the last error is smaller than , and Absorbing the displayed order- term and this logarithmic change into proves (4). ◻
The term in this calculation has two sources. One comes from taking , the other from correcting for the finite grid. The available bound for the remainder of is too large to identify a third coefficient in . The unit correction is relative to the exact integral.
Individual squares and mixed products
For any one of the waves, multiplication by its index permutes the sampling addresses. All the individual squares consequently have the same grid mean. The mixed products retain the arithmetic of the two indices, and it is here that both the squared-logarithm term and the limiting unit discrepancy enter.
Proposition 29 (The leading split). For an odd prime , put and . Then where the inverse is modulo . Its diagonal part is Consequently,
Proof. Each ordered pair in the square of Proposition 5 has indices . The change of variable is a permutation, so This proves (45). On the diagonal, . The elementary sums of integers and their squares give which proves (46) and (47). Subtract this from Theorem 1 to obtain (48). ◻
Thus the individual squares and mixed products carry one third and two thirds of the leading energy. The ratio is asymptotic. At base three, for instance, and .
One can also group (45) by the address ratio. Let count ordered pairs with . Then . For every nonzero residue modulo , : each has one in the window with , and hence one . Consequently by oddness of the Dedekind sum. This explains why the complete energy has no contribution from the lower modulus.
Corollary 30 (The unit in the mixed products). Let be the continuous mean minus the sampled mean of the sum of all ordered products of two distinct waves. With and , Restoring each distinct pair’s one-sided product at zero subtracts from this discrepancy.
Proof. Each individual wave has continuous mean square and sampled mean square by (46). Subtract their differences from the full defect and apply Theorem 2. At zero each ordered product changes from its assigned value zero to one on either side. There are such products. ◻
The squared sample at zero
At zero the field has opposite one-sided limits, but their squares agree. The table assigns zero to that entry. Replacing it by the common one-sided square keeps all the other readings and gives
For the resulting energy, Theorem 2 gives For a fixed , this error tends to zero while itself grows. The comparison is therefore finer than agreement of leading terms.
At , and the sampled energy is . The defect is and the correction is , leaving . At this finite base the contribution from the common reset exceeds the discrepancy for the entire table.
Section 10 asks how fast the error decays once this one entry has been restored. We first give another exact expression for that error.
The discrepancy by reduced ratios
For a coprime pair with , all multiples with have the same sampled mean product because multiplication by permutes the grid. Grouping by this ratio gives another way to measure the signed sum over interior resets.
Throughout this subsection , and . In the sums below and . Put As before , so the term with in is zero. The inverse in is modulo .
Rademacher’s three-term reciprocity law [14] separates the two smaller denominators from the square denominator in this sum.
Proposition 31 (The signed remainder by ratios). The exact corrections are and . Consequently,
Proof. Each unordered pair contributes to . Adding the diagonal gives .
In (20) the diagonal vanishes and , as in the calculation for . Grouping the two orders gives For fixed the first sum vanishes because runs through all units modulo and . In the second sum the change of variable by a unit gives for . At the last equality holds by convention. The definition of gives the factor . Substitution in (19) proves the formula for , and Section 8 gives the bound on .
The two orders of a reduced pair in (45) agree by inversion symmetry. They contribute . Three-term reciprocity [8] gives The first term gives times the continuous off-diagonal by (8). The constant contributes , since . The same odd row cancels and the last term gives , recovering the ratio remainder directly on the grid. ◻
A small residue of at a denominator gives a recognizable local contribution. We can bound the entire contribution of such denominators before estimating their signs against one another. For , let be the representative of in and put A complete period vanishes. Expanding as a count of multiples expresses the th row of as , since .
Proposition 32 (Denominators close to the prime square). For integers , In particular this absolute mass tends to zero for . At it is , and every remaining row has only positive floor levels.
Proof. Put . Splitting the sum at gives . For fixed , put . As runs through , the residues have multiplicity at most on the reduced grid of denominator . Their absolute cotangent sum is at most . The finite cotangent formula of Lemma 17 now gives Each prefix costs at most this first moment after complete periods are removed. The sum of absolute prefixes in one row is therefore .
Each selected divides . Apply the classical divisor estimate [17] at the endpoints of the two intervals next to . The number of rows is at most The product of this count and the bound for one row gives the stated estimate after division by . Outside the selected rows one has , giving the floor-level assertion. ◻
The ratio table also records exactly when a new reduced pair enters. For let , and write Dividing by their gcd leaves unchanged, since that gcd permutes the grid addresses. Grouping by the gcd and applying Möbius inversion gives For each primitive pair occurs in two orders. To see its contribution to the ratio error put . Then Indeed, pair with . Modulo one has , and modulo one has . Three-term reciprocity for leaves for each unordered pair. The rational terms sum as written because and . Multiplying this identity by and summing over recovers the rows of . The row is zero.
The square-root conjecture for the sampling defect
In base five the centered carries have total squared energy . The continuous energy is , so the integral exceeds the grid mean by . Restoring the square at the common reset adds to the mean. The corrected discrepancy is . For growing primes the corrected discrepancy tends to zero. How quickly do the positive and negative contributions from the other resets cancel?
Conjecture 33 (Square-root sampling rate). For every , as through odd primes.
By (19), this is equivalent to In the original carry table this would give . For a known continuous mean square, the error allowed in the carry energy would fall by a factor of . The three principal allowances in (43) satisfy Their maximum is at least , attained at . Improving the exponent therefore requires a sharper estimate for at least one range, or cancellation between ranges. Changing the two cutoffs alone can give no saving beyond the quarter power.
The two residue classes beside in Section (*) give one reason to test the square-root scale. On the central band their signed contribution at denominator is . At most one of the two indicators is nonzero. Each nonzero has order , and Proposition 15 gives total mass of order for each sign. Hence on this band. Under independent, equally likely sign reversals the root mean square of their sum would be . In the actual table the residue of fixes each sign. Including all the coprime classes in the same prefixes brings the mass of each sign to order .
At a finite prime we can read both the cubic correction and the remaining signed discrepancy in the same table. The first numerical column is . The last subtracts one from the defect before multiplying by , the scale of the conjecture.
| 13 | 4.1006 | 0.6666 | |
| 31 | 5.2102 | 1.1948 | |
| 101 | 6.8853 | 2.1581 | |
| 499 | 9.6432 | 3.9106 | |
| 1009 | 10.6655 | 4.8473 |
The entries use the GCD sum and (19), with each Dedekind sum evaluated by reciprocity. Among the 29 primes from 101 through 251, the defect exceeds one at 23 and falls below one at six. At the scaled difference is still about . These finite readings are consistent with the proposed scale. The outstanding question is whether the positions of all the interior resets enforce that much cancellation at every prime.
Earlier versions.
The collision-free multipliers for prime denominators appear in The Collision Invariant (March 29, 2026). The cubic law, its split and the character moment appear together in Digit Collisions and Carry-Boundary Spectra (June 4, 2026), later titled The Cubic Law for Digit-Collision Energy. The change of address and the squared-logarithm term for the integral and the table are in The Secondary Term in Digit-Collision Energy (June 2026, revised in August). Zenodo dates its first edition July 1, 2026. The Unit Sampling Defect in Digit-Collision Energy (October 10, 2026) proves convergence of the defect to one. The quarter-power bound appears in the revision of November 2, 2026.
Funding
This research received no external funding.
Disclosure statement
The author reports no competing interests.
References
[1]C. Aistleitner, I. Berkes, and K. Seip, GCD sums from Poisson integrals and systems of dilated functions, J. Eur. Math. Soc. 17 (2015), no. 6, 1517–1546, https://doi.org/10.4171/JEMS/537.
[2]M. Beck, Dedekind cotangent sums, Acta Arith. 109 (2003), no. 2, 109–130, https://doi.org/10.4064/aa109-2-1.
[3]S. Bettin and V. Chandee, Trilinear forms with Kloosterman fractions, Adv. Math. 328 (2018), 1234–1262, https://doi.org/10.1016/j.aim.2018.01.026.
[4]J. B. Conrey, E. Fransen, R. Klein, and C. Scott, Mean values of Dedekind sums, J. Number Theory 56 (1996), 214–226, https://doi.org/10.1006/jnth.1996.0014.
[5]T. Estermann, On Kloosterman's sum, Mathematika 8 (1961), 83–86, https://doi.org/10.1112/S0025579300002187.
[6]P. Flajolet and B. Salvy, Euler sums and contour integral representations, Experiment. Math. 7 (1998), no. 1, 15–35.
[7]S. W. Graham and G. Kolesnik, Van der Corput's Method of Exponential Sums, London Mathematical Society Lecture Note Series, vol. 126, Cambridge University Press, 1991, https://doi.org/10.1017/CBO9780511661976.
[8]R. R. Hall, J. C. Wilson, and D. Zagier, Reciprocity formulae for general Dedekind–Rademacher sums, Acta Arith. 73 (1995), 389–396.
[9]T. Hilberdink, F. Luca, and L. Tóth, On certain sums concerning the gcd's and lcm's of positive integers, Int. J. Number Theory 16 (2020), no. 1, 77–90, https://doi.org/10.1142/S1793042120500049.
[10]M. N. Huxley, Identities involving Farey fractions, Proc. Steklov Inst. Math. 276 (2012), no. 1, 125–139, https://doi.org/10.1134/S0081543812010105.
[11]E. Krätzel, W. G. Nowak, and L. Tóth, On certain arithmetic functions involving the greatest common divisor, Cent. Eur. J. Math. 10 (2012), no. 2, 761–774, https://doi.org/10.2478/s11533-011-0144-6.
[12]S. R. Louboutin and M. Munsch, Mean square values of -functions over subgroups for nonprimitive characters, Dedekind sums and bounds on relative class numbers, Canad. J. Math. 75 (2023), no. 5, 1711–1743, https://doi.org/10.4153/S0008414X2300010X.
[13]A. S. Petty, The alignment deficit lattice and musical tuning, Journal of Mathematics and Music (2026), 1–7, https://doi.org/10.1080/17459737.2026.2741838.
[14]H. Rademacher, Generalization of the reciprocity formula for Dedekind sums, Duke Math. J. 21 (1954), no. 3, 391–397, https://doi.org/10.1215/S0012-7094-54-02140-7.
[15]B. Saffari and R. C. Vaughan, On the fractional parts of and related sequences. II, Ann. Inst. Fourier (Grenoble) 27 (1977), no. 2, 1–30, https://doi.org/10.5802/aif.649.
[16]I. E. Shparlinski, On some weighted average values of -functions, Bull. Aust. Math. Soc. 79 (2009), no. 2, 183–186, https://doi.org/10.1017/S0004972708001020.
[17]E. C. Titchmarsh, The Theory of the Riemann Zeta-Function, second ed., revised by D. R. Heath-Brown, Clarendon Press, Oxford, 1986.
[18]H. Walum, An exact formula for an average of -series, Illinois J. Math. 26 (1982), no. 1, 1–3, https://doi.org/10.1215/ijm/1256046895.
[19]A. Weil, On some exponential sums, Proc. Nat. Acad. Sci. U.S.A. 34 (1948), no. 5, 204–207, https://doi.org/10.1073/pnas.34.5.204.
[20]W. Zhang, On the mean values of Dedekind sums, J. Théor. Nombres Bordeaux 8 (1996), no. 2, 429–442, https://doi.org/10.5802/jtnb.179.
[21]W. Zhang, On the mean value of -functions with the weight of character sums, J. Number Theory 128 (2008), 2459–2466, https://doi.org/10.1016/j.jnt.2007.11.008.