For an odd prime base b, the
complete lag-one carry table compares the two digits of a remainder word
over every unit multiplier modulo b2.
After its residue-class means are removed, let Eb be the resulting centered square mass. We
prove Eb=b3+O(b2(logb)2), with diagonal and off-diagonal leading terms 31b3 and 32b3. Thus the cubic mass divides in
the proportion 1:2.
The observable belongs to Hamming correlation, and its continuous
leading scale has a classical GCD and LCM sum analogue. The result here
concerns its complete prime-square realization without a primitive-root
hypothesis. An exact dictionary identifies Eb as a threshold-crossing variance, a
Bernoulli-weighted primitive-character square mass, and a weighted
average of classical Dedekind sums. Removing the weight gives a double
sum over collision ratios. Rademacher reciprocity exposes the exact
diagonal and coprime off-diagonal contributions, while oddness and a
first absolute moment control the remainders. The character form also
gives an exact weighted L(1) moment.
The secondary coefficient is not claimed here.
In base 3, the six unit residues
modulo 9 have centered collision energy
16/3. As the odd prime base b grows, the corresponding finite square mass
grows on the cubic scale. Equal collision ratios carry one third of the
leading term. Unequal coprime ratios carry the other two thirds. The
1:2 proportion concerns the leading
coefficients as the prime base grows; the finite diagonal and
off-diagonal masses have separate error terms.
A lag-one digit collision asks whether the leading and trailing
digits of a two-digit remainder word agree. Centering its carry table
within each residue class modulo b
removes the deterministic class means and leaves a square mass Eb. The size of Eb measures the fluctuation carried by the
finite digit boundary.
The same finite object has additive and multiplicative readings.
Intervals and carries produce the table. Residue classes, characters,
and Dedekind sums expose its spectrum. The proof moves between these
readings without changing the object.
The collision statistic asks when the leading base-b digit bins of two scaled remainders
collide. After a finite slice decomposition, that condition becomes
membership in the diagonal Gℓ,b={0≤n<bℓ+1:⌊n/bℓ⌋≡n(modb)}, the set of
(ℓ+1)-digit words whose leading
digit equals the trailing digit. The boundary of this diagonal is the
finite source of the spectral coefficients.
Agreement between a finite sequence and its cyclic shifts belongs to
classical Hamming-correlation theory [14]. Kak and Chatterjee studied
prime-reciprocal digit sequences as communication codes and obtained
bounds for their Hamming distance from cyclic shifts and for their
autocorrelation [13]. The collision diagonal uses that
same coordinate-agreement observable. It is not introduced here. The
present problem instead asks for the total centered energy of the
complete unit table modulo b2, without
assuming that a chosen base generates a full reciprocal orbit.
A neighboring number-theoretic literature studies the values of
digits along multiplicative reciprocal orbits. Girstmair connected those
values with class-number factors and expressed digit variance through
Dedekind sums [8, 9, 10].
Murty and Thangadurai treated bases of prescribed order through
generalized Bernoulli numbers and Dirichlet L-values [17]. Those orbitwise digit-value
statistics are distinct from the equality indicator and complete
multiplier ensemble used here, but they establish the surrounding
arithmetic setting.
The leading mass also has a classical continuous analogue.
Hilberdink, Luca, and Tóth [11] prove that r,s≤N∑rs(r,s)2=3N+O((logN)2). This sum is three times the continuous square mass of
2∑r≤N((rx)). Its leading scale
is therefore already known. The finite prime-square table requires the
exact carry, character, and Dedekind identities developed below.
The contribution proved here is the exact phase reduction of the
boundary flux to a short character sum, the identification of the same
finite energy as a carry-table variance and collision-weighted Dedekind
average, and the weight-free reduced-ratio decomposition. Rademacher
reciprocity then gives the cubic law while retaining the exact diagonal
and proves the 1:2 leading split. The
theorem concerns this specified finite ensemble and its
normalization.
The main theorem is the cubic law for digit-collision energy. For odd
primes b, with the lag-one energy Eb defined by the threshold carry table in
Section 3, Eb=b3+O(b2(logb)2), and
the leading term splits as a diagonal contribution 31b3 and an off-diagonal contribution
32b3. The argument proves this
statement from the finite table definitions.
The Dedekind average places the collision table inside a classical
theory. Reciprocity is presented by Rademacher and Grosswald [19] and by Apostol
[1]. Mean values and
moments were studied by Conrey, Fransen, Klein, and Scott [5]. Bettin and Conrey
connect related cotangent sums with period functions [3]. Restricted averages
and subgroup correlations are studied in [16, 4].
The geometry below instead fixes the modulus b2 and restricts both ratio coordinates to
the first digit window.
The multiplicative form uses generalized Bernoulli numbers, Dirichlet
characters, and Dirichlet L-functions.
Standard references include Davenport [6], Washington [20], and Iwaniec and Kowalski [12]. The character
summation formulas used here are due to Berndt [2]. Mean squares of L(1,χ) over character families and
subgroups, together with their Dedekind-sum expressions, are also
established subjects [15]. The moment below has the specific
short-window weight forced by the collision table.
The Collision Spectrum
The collision spectrum is the character transform of the digit
boundary. The diagonal gives the finite setting. The asymptotic proof
begins with the lag-one carry table.
Collision diagonal
Fix b≥2, ℓ≥1, and m=bℓ+1. For a residue nmodm, write its (ℓ+1)-digit base-b expansion with leading zeros allowed. The
lag-ℓ collision condition compares
the leading and trailing digits of this word, and therefore forces the
finite diagonal Gℓ,b={0≤n<m:⌊n/bℓ⌋≡n(modb)}.
Remark 1 (Finite collision diagonal). The integer n records the residue of the relevant scaled
remainder modulo m. Writing n=dℓbℓ+⋯+d1b+d0,0≤di<b, the leading digit is dℓ=⌊n/bℓ⌋, while the
trailing digit is d0≡n(modb).
Same-bin membership is therefore the equality dℓ=d0, which is exactly the displayed
congruence defining Gℓ,b. This
ambient diagonal language motivates the lag-one prime-base table below;
the cubic theorem itself begins from the explicit threshold table of
Section 3.
Primitive odd factorization
For a Dirichlet character χ
modulo q, write B1,χ(q)=q1a=1∑q−1χ(a)a.
When the modulus is fixed by context, write B1,χ. We use the standard sawtooth
notation ((x))={x}−21 for
nonintegral x, with ((x))=0 for integral x.
The Fourier convention is f(χ)=φ(m)1x∈(Z/mZ)×∑f(x)χ(x).
Lemma 2 (Odd sawtooth expansion). Let q≥2. For (a,q)=1, ((qa))=φ(q)1χmodqχ(−1)=−1∑B1,χχ(a).
Proof. On the finite group (Z/qZ)×, expand ((a/q))=∑χλχχ(a).
Orthogonality gives λχ=φ(q)1(a,q)=1∑((qa))χ(a). For nonprincipal χ, the constant part of ((a/q))=a/q−21 sums to zero, so (a,q)=1∑((qa))χ(a)=q1a=1∑q−1χ(a)a=B1,χ. The sawtooth is odd, so only odd
characters survive. The principal character is even and contributes
nothing. This is the character-analogue Euler–Maclaurin expansion of
[2]. ◻
For lag one in prime base, the centered collision function is defined
directly from the carry table in Definition 8, and
Theorem 10 proves the exact primitive odd
factorization. The conjugate Bernoulli index B1,χ appears in the
coefficient with the Fourier convention above; square masses are
unchanged because B1,χ=B1,χ.
For the lag-one diagonal G=G1,b={r(b+1):0≤r≤b−1}, write
SG(χ)=r=0∑b−1(χ(r(b+1)+1)−χ(r(b+1))).
Imprimitive odd sector
For the prime-square lag-one theorem, the imprimitive odd sector has
an exact vanishing statement.
Proposition 3 (Prime-square imprimitive vanishing).
Let b be an odd prime, and let
χmodb2 be odd and induced from a
character modulo b. Then Sχ:=k=1∑b−1χ(k)=0.
Consequently, the lag-one boundary flux also vanishes. SG(χ)=0.
Proof. The values 1,…,b−1 form the complete reduced
residue system modulo b, so Sχ=0 by character orthogonality for the
nonprincipal character inducing χ.
Since χ is odd, Lemma 5 gives SG(χ)=−2χ(b+1)Sχ=0. ◻
Parseval mass layer
The energy of any explicitly centered collision function is its
finite Parseval square mass. The prime-square lag-one specialization is
carried out from the table definitions in Definition 8 through Corollary 12.
Lemma 4 (Parseval mass formula). Put U=(Z/mZ)×. For every
function S∘:U→C,
the Fourier convention above gives x∈U∑∣S∘(x)∣2=φ(m)χmodm∑∣S∘(χ)∣2.
Proof. Fourier inversion on U gives S∘(x)=χmodm∑S∘(χ)χ(x),S∘(χ)=φ(m)1x∈U∑S∘(x)χ(x).
Orthogonality on U gives the
square-mass identity x∈U∑∣S∘(x)∣2=φ(m)χmodm∑∣S∘(χ)∣2. ◻
Lemma 5 (Lag-one boundary reduction). Let m=b2, G=G1,b={r(b+1):0≤r≤b−1}, and
extend Dirichlet characters by zero on nonunits. For every odd character
χmodb2, SG(χ)=−2χ(b+1)k=1∑b−1χ(k). Consequently, if
Sχ=∑k=1b−1χ(k), then
∣SG(χ)∣2=4∣Sχ∣2.
Proof. Write SG(χ)=Q−αP,α=χ(b+1),P=k=1∑b−1χ(k), where Q=r=0∑b−2χ(r(b+1)+1). The n-terms give αP, because χ(r(b+1))=χ(b+1)χ(r), with both
sides zero when r is not a unit. The
n+1-term at r=b−1 is χ(b2)=0, which is why Q stops at b−2.
The reflection b2−(r(b+1)+1)=(b−1−r)(b+1) maps
r=0,…,b−2 bijectively to j=1,…,b−1. Since χ is odd, χ(b2−a)=−χ(a), and therefore −Q=j=1∑b−1χ(j(b+1))=αj=1∑b−1χ(j)=αP. Thus Q=−αP, so SG(χ)=−2αP. Since b+1 is a unit modulo b2, ∣χ(b+1)∣=1, giving the absolute-square
identity. ◻
Remark 6 (Short-window identity). Lemma 5 gives the
phase-sensitive short-window identity for every odd character modulo
b2.
Prime-Base Carry Table
In prime base at lag one the same spectral energy has a direct table
form. The asymptotic estimate is most concrete in this carry-table
language.
Let b be an odd prime. Throughout, a
unit amodb2 is represented by the
unique integer 1≤a<b2 with (a,b)=1.
The raw lag-one table follows unit multiples of the two-digit
diagonal. Write a residue nmodb2 as
n=bq+r, 0≤q,r<b. The collision diagonal is G1,b={(b+1)d:0≤d<b}, the set of
two-digit words whose two digits agree. Multiplication by a unit a permutes the residue system. For each
diagonal point d, the row entry records
whether the translated point crosses the terminal boundary when advanced
by a. Id(a)=1[(b+1)damodb2≥b2−a].
Equivalently, Id(a)=⌊b2((b+1)d+1)a⌋−⌊b2(b+1)da⌋. Thus the
row sum of this explicit collision table is the finite
threshold-crossing count fb(a)=#{0≤d≤b−1:(b+1)damodb2≥b2−a}, and the centered
row statistic is S1(a)=fb(a)−1−⌊ba−1⌋,Vb=amodb2(a,b)=1∑S1(a)2. The
prime-base lag-one collision energy is the class-centered square mass
Eb=Vb−6(b−1)(2b−1).
Equivalently, if Ss is the
mean of S1(bq+s) over 0≤q<b, then Ss=−(b−s)/b, and Eb=s=1∑b−1q=0∑b−1(S1(bq+s)−Ss)2. Finally set Tb(a)=2fb(a)−2(1+⌊ba−1⌋)+1. Thus Tb(a)=2S1(a)+1. The
centered square mass of Tb is the
half-centered table-side form of the collision energy.
A base-three example.
The units modulo 9 are 1,2,4,5,7,8. In that order, the six threshold
counts and their class-centered values are af3(a)S1(a)−Samod311322234423251−3271−3482−32 and hence E3=a∈(Z/9Z)×∑S1(a)−Samod32=316. The
centering removes the separate means of the two residue classes modulo
3. What remains is the collision energy
estimated below for general prime base.
Lemma 7 (Carry-table column law). Let b be an odd prime and 1≤s≤b−1. Then q=0∑b−1fb(bq+s)=2b(b−1)+s,Ss:=b1q=0∑b−1S1(bq+s)=−bb−s.
Consequently s=1∑b−1bSs2=6(b−1)(2b−1), and Eb=s=1∑b−1q=0∑b−1(S1(bq+s)−Ss)2.
Proof. Two elementary floor identities are used. If (m,b)=1 and K∈Z, then q=0∑b−1⌊bmq+K⌋=2(m−1)(b−1)+K, because the residues mq+Kmodb run once through 0,…,b−1. For any integer m≥0 and 0≤s<b, ⌊b2m(bq+s)⌋=⌊bmq+⌊ms/b⌋⌋. The threshold indicator has the floor-difference form 1[(ymodb2)≥b2−a]=⌊b2y+a⌋−⌊b2y⌋, with y=(b+1)da. Therefore, for a=bq+s, fb(a)=d=0∑b−1(⌊b2((b+1)d+1)a⌋−⌊b2(b+1)da⌋). For d=0, this
contribution is 0 for every q. For 1≤d≤b−2, both multipliers (b+1)d and
(b+1)d+1 are units modulo b, and their contribution to ∑qfb(bq+s) is 2b−1+(⌊b((b+1)d+1)s⌋−⌊b(b+1)ds⌋)=2b−1+εd, where εd=1[(dsmodb)+s≥b].
For d=b−1, the upper multiplier is
b2, and the lower multiplier is b2−1. The same calculation gives
contribution b.
As d runs over 1,…,b−1, the residue dsmodb runs over 1,…,b−1, and exactly s of these residues are at least b−s. Since εb−1=1, the partial sum over
1≤d≤b−2 is s−1. Hence q=0∑b−1fb(bq+s)=(b−2)2b−1+(s−1)+b=2b(b−1)+s. It follows that q=0∑b−1S1(bq+s)=2b(b−1)+s−b−2b(b−1)=s−b, so Ss=−(b−s)/b. The square-mean
identity follows by summing b(b−s)2/b2 over s, and expanding the doubly centered mass
gives Vb−∑sbSs2=Eb. ◻
Definition 8 (Centered collision function). For an
odd prime b, define S∘ on (Z/b2Z)× by S∘(a)=S1(a)−Samodb,
using the least positive representative 1≤a<b2, and extend it by zero to nonunits. Lemma 7 gives a∈(Z/b2Z)×∑∣S∘(a)∣2=Eb.
Lemma 9 (Primitive floor transform). Let χ be a primitive odd character modulo
b2, and let m be an integer with 1≤m<b2 and (m,b)=1. Then amodb2(a,b)=1∑⌊b2ma⌋χ(a)=(m−χ(m))B1,χ(b2).
Proof. For a unit a, the
quotient ma/b2 is not an integer, so
⌊b2ma⌋=b2ma−((b2ma))−21. The constant term drops after summing against
χ. The linear part gives
b2ma∑aχ(a)=mB1,χ(b2). For the sawtooth
part, substitute a↦m−1a and
apply Lemma 2. a∑((b2ma))χ(a)=χ(m)a∑((b2a))χ(a)=χ(m)B1,χ(b2). Subtracting gives the
identity. ◻
Theorem 10 (Lag-one collision factorization).
Let b be an odd prime and let χ be a primitive odd character modulo
b2. Then S∘(χ)=φ(b2)1amodb2(a,b)=1∑S∘(a)χ(a)=−φ(b2)B1,χ(b2)SG(χ).
Proof. The centering constant contributes nothing, since
∑a≡s(b)χ(a)=0
for primitive χ. Indeed, a nonzero
fiber sum would make χ trivial on
the kernel of (Z/b2Z)×→(Z/bZ)×,
forcing χ to descend to modulus
b. Thus a∑S∘(a)χ(a)=a∑S1(a)χ(a). The constant term in S1(a)=fb(a)−1−⌊(a−1)/b⌋
vanishes by nonprincipality. On units, ⌊(a−1)/b⌋=⌊a/b⌋, and
the sawtooth part of ⌊a/b⌋
depends only on amodb, so its
primitive character sum vanishes. Hence a∑⌊ba−1⌋χ(a)=bB1,χ(b2).
For fb, use the floor-difference
formula from Lemma 7 with multipliers md+=(b+1)d+1 and md−=(b+1)d. The exceptional terms are m0−=0, which contributes 0, and mb−1+=b2, whose floor is a and therefore contributes b2B1,χ(b2). Lemma 9 gives all remaining terms, so
a∑fb(a)χ(a)=b2B1,χ(b2)+B1,χ(b2)[d=0∑b−2(md+−χ(md+))−d=1∑b−1(md−−χ(md−))]. The integer parts satisfy d=0∑b−2md+−d=1∑b−1md−=−b(b−1),
so their net contribution with the exceptional term is bB1,χ(b2). For the
character parts, d=0∑b−2χ(md+)−d=1∑b−1χ(md−)=Q−χ(b+1)Sχ=−2χ(b+1)Sχ=SG(χ), using Lemma 5. Therefore a∑fb(a)χ(a)=bB1,χ(b2)−B1,χ(b2)SG(χ). Subtracting the
⌊(a−1)/b⌋ contribution
cancels the bB1,χ(b2) term and leaves
a∑S1(a)χ(a)=−B1,χ(b2)SG(χ). Dividing by φ(b2) proves the theorem. ◻
Lemma 11 (Carry-table reflection law). Let a be a unit represented by 1≤a<b2, and put a∗=b2−a. Then fb(a)+fb(a∗)=b,Tb(a∗)=−Tb(a), and S∘(b2−a)=−S∘(a).
Proof. Put xd=(b+1)damodb2. For a∗=b2−a, the
reflected residue is −xdmodb2. The
term d=0 contributes to neither
threshold. For 1≤d≤b−1, the two
threshold indicators sum to 1+1[xd=b2−a]. The congruence xd=b2−a is equivalent to (b+1)d≡−1modb2, whose unique
solution in 1≤d≤b−1 is d=b−1. Hence fb(a)+fb(a∗)=b.
If a=bq+s, 1≤s<b, then a∗=b(b−1−q)+(b−s), so S1(a)+S1(a∗)=fb(a)+fb(a∗)−1−q−1−(b−1−q)=−1. Equivalently, Tb(a∗)=−Tb(a). Since Ss+Sb−s=−1, the
centered function satisfies S∘(a)+S∘(a∗)=S1(a)+S1(a∗)−Ss−Sb−s=0. ◻
Corollary 12 (Lag-one spectral energy formula).
For odd primes b, with Sχ=∑k=1b−1χ(k), Eb=φ(b2)4χmodb2primitiveχ(−1)=−1∑∣B1,χ(b2)∣2∣Sχ∣2.
Proof. Lemma 11
gives S∘(b2−a)=−S∘(a), so
even characters vanish. If χ is
imprimitive modulo b2, induced from
modulus b, then χ is constant on each residue class modulo
b, and the class-centering gives amodb2(a,b)=1∑S∘(a)χ(a)=s=1∑b−1χ(s)q=0∑b−1S∘(bq+s)=0. Thus the imprimitive
sector vanishes directly from the table centering. Parseval on (Z/b2Z)×, together
with Definition 8 and Theorem 10, gives Eb=φ(b2)χprimitiveodd∑∣S∘(χ)∣2=φ(b2)1χprimitiveodd∑∣B1,χ(b2)∣2∣SG(χ)∣2. Finally, ∣SG(χ)∣2=4∣Sχ∣2 by Lemma 5. ◻
Theorem 13 (Threshold-energy normalization). For
odd prime b, the lag-one threshold
variance satisfies Vb=amodb2(a,b)=1∑(fb(a)−1−⌊ba−1⌋)2.
With Tb(a)=2S1(a)+1, one has the
exact normalizations Vb=41amodb2(a,b)=1∑Tb(a)2+41b(b−1), and Eb=41amodb2(a,b)=1∑Tb(a)2−12(b−1)(b−2).
Proof. The lag-one diagonal has step b+1. In row a, multiplication by (b+1)d crosses the terminal boundary of the
modulus exactly when (b+1)damodb2≥b2−a. Thus fb(a) is the
number of diagonal steps whose translate crosses the right endpoint of
the a-window. The deterministic block
count is μb(a)=1+⌊ba−1⌋,
the number of base-b blocks met by the
interval of length a, including its
final partial block. Hence the threshold variance is Vb=(a,b)=1∑(fb(a)−μb(a))2. The class-centering correction enters later through the means
Ss. The half-centered
integer normalization satisfies Tb(a)=2(fb(a)−μb(a))+1, so
Tb(a)=2S1(a)+1. The reflection a∗=b2−a gives Tb(a∗)=−Tb(a) by Lemma 11. Since S1(a)2=41Tb(a)2−21Tb(a)+41,
the linear term cancels after summing over reflection pairs of units,
and (a,b)=1∑S1(a)2=41(a,b)=1∑Tb(a)2+41φ(b2). Thus
Vb=41(a,b)=1∑Tb(a)2+41b(b−1).
The class-centering correction is exact. Eb=Vb−6(b−1)(2b−1). Indeed, Ss=−(b−s)/b, so s=1∑b−1bSs2=b1s=1∑b−1(b−s)2=6(b−1)(2b−1). Consequently Eb=41(a,b)=1∑Tb(a)2+41b(b−1)−6(b−1)(2b−1), or, in compact form,
Eb=41(a,b)=1∑Tb(a)2−12(b−1)(b−2). Thus the difference between Eb and 41∑Tb(a)2 is O(b2) with a
displayed closed form. ◻
Theorem 13 shows that the cubic energy law is
equivalent to (a,b)=1∑Tb(a)2=4b3+O(b2(logb)2).
Dedekind Compression
The same prime-base energy compresses into a weighted average of
classical Dedekind sums. This places the finite collision table inside a
standard analytic object without changing the source of the weight.
Two steps produce the compression. Bernoulli coefficients first turn
the centered mass into a cotangent-pair kernel. The classical cotangent
identity then evaluates that kernel as a Dedekind sum. Second, the
collision geometry supplies the weight. A residue vmodb2 is counted exactly as many times
as there are window entries k for which
kv lands back in the first digit window
{1,…,b−1}. Thus the Dedekind sum
is classical, but the weight is the original carry-boundary collision
count.
Definition 14 (Dedekind sum). For (h,m)=1 set ((x))={{x}−21,0,x∈/Z,x∈Z,s(h,m)=a=1∑m−1((ma))((mha)).
Definition 15 (Collision weight). For a unit v modulo b2 define wb(v)=#{1≤k≤b−1:vkmodb2∈{1,…,b−1}}. Writing v=α+bβ with 1≤α≤b−1, this is wb(α+bβ)=#{1≤k≤b−1:βk+⌊αk/b⌋≡0(modb)}.
Theorem 16 (Weighted Dedekind identity). For odd
prime b, the prime-base lag-one energy
satisfies Eb=b21vmodb2(v,b)=1∑wb(v)(4b2s(v,b2)−4bs(vmodb,b)). The mod-b
correction cancels after weighting, so Eb=4vmodb2(v,b)=1∑wb(v)s(v,b2).
Proof. Put q=b2. By the
lag-one spectral energy identity, Corollary 12,
Eb=φ(q)4χmodqprimitiveχ(−1)=−1∑∣B1,χ∣2∣Sχ∣2,Sχ=k=1∑b−1χ(k). Imprimitive odd
characters modulo q are induced from
modulus b, and the window sum Sχ vanishes on them by orthogonality over
the complete reduced residue system modulo b. The displayed primitive sum is therefore
the full odd contribution.
For every character χmodq, put
Cχ=umodq(u,q)=1∑χ(u)cotqπu. With τ(χ)=amodq∑χ(a)e2πia/q, the standard finite cotangent transform [19, 20]
gives, for primitive odd χ, Cχ=2iτ(χ)B1,χ=−τ(χ)2iqB1,χ. Since ∣τ(χ)∣=q, 4q∣B1,χ∣2=∣Cχ∣2 and hence,
since q=b2, qEb=φ(q)1χmodqprimitiveχ(−1)=−1∑∣Cχ∣2∣Sχ∣2. On the other hand, define K(u)=k=1∑b−1cotqπ(uk−1modq). The function K(u) is real-valued, and multiplicative
Parseval on (Z/qZ)× gives umodq(u,b)=1∑∣K(u)∣2=φ(q)1χmodq∑∣Cχ∣2∣Sχ∣2. Indeed, the
χ-coefficient of K is φ(q)1u∑K(u)χ(u)=φ(q)1(k=1∑b−1χ(k))Cχ.
Even characters have Cχ=0, and
imprimitive odd characters have Sχ=0, so the full character sum reduces
to the primitive odd sum above. Thus b2Eb=umodq(u,b)=1∑∣K(u)∣2. Expanding
this square gives a sum over pairs k,ℓ∈{1,…,b−1}. After the change
of variables x=uk−1 and v≡kℓ−1(modq), this becomes umodq(u,b)=1∑∣K(u)∣2=vmodq(v,b)=1∑wb(v)Γ(v),
where Γ(v)=umodq(u,b)=1∑cotqπucotqπuv. The multiplicity
of a given ratio v is exactly wb(v), because it counts the first-window
entries r for which vrmodq is again in the first window.
It remains to evaluate Γ(v).
The classical cotangent-Dedekind identity a=1∑m−1cotmπacotmπha=4ms(h,m) gives 4qs(v,q) when summed over all 1≤u<q. The excluded nonunits are u=bt, 1≤t<b, and their contribution is t=1∑b−1cotbπtcotbπ(vmodb)t=4bs(vmodb,b). Thus Γ(v)=4b2s(v,b2)−4bs(vmodb,b),
and division by b2 gives the first
displayed identity.
For the correction term, write v=α+bβ. For fixed α, βmodb∑wb(α+bβ)=b−1.
Indeed, for each 1≤k<b the
congruence βk+⌊αk/b⌋≡0(modb) has a unique solution βmodb, since k is a unit modulo b. Thus the correction contributes (b−1)α=1∑b−1s(α,b)=0, by
the reflection s(−u,b)=−s(u,b). The
weighted identity therefore reduces to Eb=4v∑wb(v)s(v,b2). ◻
Corollary 17 (Prime-square energy dictionary).
For odd primes b, the threshold
energy, the centered carry mass, the primitive odd character mass, and
the weighted Dedekind average are the same finite object. Eb=a∈(Z/b2Z)×∑∣S∘(a)∣2=φ(b2)4χmodb2primitiveχ(−1)=−1∑∣B1,χ(b2)∣2∣Sχ∣2=4vmodb2(v,b)=1∑wb(v)s(v,b2).
Proof. The first identity is Definition 8, the second
is Corollary 12, and the third is Theorem 16. ◻
Proposition 18 (Weight-free collision double sum).
The weighted Dedekind energy is equivalently Eb=4k=1∑b−1u=1∑b−1s(k−1umodb2,b2), where k−1 is taken modulo b2.
Proof. By definition wb(v)
counts the pairs (k,u) with 1≤k,u≤b−1 and kv≡u(modb2). Since k is a unit modulo b2, the congruence determines v≡k−1u(modb2). Substituting
this parametrization into Eb=4∑vwb(v)s(v,b2) gives the identity. ◻
This identity removes the weight entirely. Instead of asking how
often a given v occurs, the sum runs
directly over the two window coordinates (k,u). The diagonal u=k is then visible without further analysis,
and the off-diagonal can be grouped by the reduced rational ratio u/k.
Lemma 19 (Reduced-ratio invariance). If g=gcd(k,u), k=gk′, and u=gu′, then s(k−1umodb2,b2)=s(k′−1u′modb2,b2), so each summand in Proposition 18 depends only on the reduced
rational ratio u/k.
Proof. Because 1≤g<b,
the integer g is a unit modulo b2. Therefore (gk′)−1(gu′)≡k′−1u′(modb2), and the Dedekind sum depends only
on the residue class of its first argument modulo b2. ◻
Proposition 20 (Reduced-ratio pole split). The
diagonal part of the double sum is Δb=4(b−1)s(1,b2)=3b2(b−1)(b2−1)(b2−2)=31b3+O(b2). The off-diagonal part is exactly Offb=81≤k<a≤b−1(a,k)=1∑⌊ab−1⌋s(k−1amodb2,b2), and Eb=Δb+Offb.
Proof. On the diagonal u=k
the residue is k−1u≡1(modb2), which gives Δb=4(b−1)s(1,b2). The classical
evaluation s(1,m)=(m−1)(m−2)/(12m) with
m=b2[19] produces the displayed closed
form.
For u=k, the two orientations
(k,u) and (u,k) have inverse Dedekind arguments. The
symmetry s(h,m)=s(h−1,m), obtained
from the substitution x↦hx in
the defining sum, lets us pair these two orientations with a factor
2, choosing the orientation whose
larger reduced coordinate is a. Write
(k,u)=(tk′,ta′),a′>k′≥1,(a′,k′)=1. The condition
1≤k,u≤b−1 is then exactly 1≤t≤⌊a′b−1⌋. Renaming (a′,k′) as (a,k), each reduced pair occurs with
multiplicity ⌊(b−1)/a⌋. The
original factor 4 in the double sum and
the two orientations give the factor 8. ◻
Proof. Let Hn=∑j=1nj−1, with H0=0. The series
below are absolutely convergent, so Möbius inversion and rearrangement
give Σ=d≥1∑μ(d)a′>k′≥1∑(dk′)(da′)21=d≥1∑d3μ(d)a′>k′≥1∑k′(a′)21=ζ(3)1a≥2∑a2Ha−1. The
classical Euler sum ∑a≥1Ha/a2=2ζ(3)[7] gives a≥2∑a2Ha−1=a≥2∑a2Ha−a≥2∑a31=(2ζ(3)−1)−(ζ(3)−1)=ζ(3).
Thus Σ=1. ◻
Lemma 22 (Rademacher reciprocity reduction). For
coprime integers 1≤k<a≤b−1,
s(k−1amodb2,b2)=12kab2+121(kb2a+ab2k)−41−s(kb2(a),a)−s(b2a(k),k), where b2(a) is the inverse of
b2 modulo a. For k≥2, a(k) is the inverse of a modulo k;
for k=1, the final Dedekind sum is
interpreted as 0.
Proof. When k=1, ordinary
two-term reciprocity for the coprime pair (a,b2) gives s(a,b2)+s(b2,a)=−41+121(b2a+ab2+ab21). The symmetry s(h,a)=s(h−1,a) identifies s(b2,a) with s(b2(a),a), which is the
displayed formula with the final modulus-one term equal to zero.
Now suppose k≥2. In the following
display mj(mi) denotes the inverse
of mj modulo mi. Rademacher’s three-term reciprocity
[18] (see also
[19]) states
that for pairwise coprime positive integers m1,m2,m3, s(m2m3(m1),m1)+s(m3m1(m2),m2)+s(m1m2(m3),m3)=−41+121(m2m3m1+m3m1m2+m1m2m3). Apply this with (m1,m2,m3)=(b2,a,k). The first term is
s(k−1amodb2,b2), and
solving for it gives the displayed identity. ◻
The four pieces of the exact off-diagonal decomposition are the four
terms of Rademacher reciprocity after summing over reduced ratios. The
large term b2/(12ka) gives Mainb. The constant and tiny
reciprocal terms give Rb(0). The
Dedekind sum at modulus a gives Rb(a), which vanishes because the k-sum runs over a full reduced residue system
modulo a. The Dedekind sum at modulus
k gives Rb(k), the only surviving analytic
remainder.
Proposition 23 (Four-way off-diagonal
decomposition). The off-diagonal contribution decomposes exactly as
Offb=Mainb+Rb(0)+Rb(a)+Rb(k),
where every displayed sum runs over a>k≥1, (a,k)=1, a≤b−1, and Mainb=32b2∑ka1⌊ab−1⌋,Rb(0)=8∑⌊ab−1⌋[121(kb2a+ab2k)−41],Rb(a)=−8∑⌊ab−1⌋s(kb2(a),a),Rb(k)=−8k≥2∑⌊ab−1⌋s(b2a(k),k).
Proof. Start from Proposition 20. Offb=8∑⌊ab−1⌋s(k−1amodb2,b2), where the sum is over reduced
pairs a>k≥1, a≤b−1. Substituting Lemma 22 into each summand gives 8∑⌊ab−1⌋[12kab2+121(kb2a+ab2k)−41−s(kb2(a),a)−s(b2a(k),k)]. The first term is 8⋅12b2∑ka1⌊ab−1⌋=Mainb. The constant and reciprocal terms are
Rb(0), and the two small-modulus
Dedekind sums are Rb(a) and Rb(k). These four collected pieces are
exactly the displayed decomposition. ◻
Lemma 24 (Off-diagonal main term). Mainb=32b3+O(b2(logb)2).
Proof. Put c(a)=1≤k<a(k,a)=1∑k1≤Ha−1≪loga. Then Mainb=32b22≤a≤b−1∑a1⌊ab−1⌋c(a). Writing
⌊(b−1)/a⌋=(b−1)/a−{(b−1)/a},
the principal part is 32b2(b−1)a<b∑a2c(a). By Lemma 21, ∑a≥2c(a)/a2=1, and the tail satisfies a≥b∑a2c(a)≪a≥b∑a2loga≪blogb, so the principal
part is 32b3+O(b2logb).
The floor-defect term is bounded by O(b2a<b∑ac(a))=O(b2(logb)2). ◻
Proof. The bracket in Rb(0) is O(1), so Rb(0)≪a<b∑⌊ab−1⌋φ(a)≪ba<b∑aφ(a)≪b2. ◻
Lemma 26 (a-modulus
cancellation). Rb(a)=0.
Proof. Fix a. The weight
⌊(b−1)/a⌋ is independent of
k, and as k runs through the units modulo a the residue kb2(a) also runs through
the units modulo a. Therefore 1≤k<a(k,a)=1∑s(kb2(a),a)=u∈(Z/aZ)×∑s(u,a)=0
by the reflection s(−u,a)=−s(u,a).
Multiplying by the k-independent weight
and summing over a gives the
claim. ◻
Lemma 27 (Dedekind first-moment bound). For
k≥2, M1(k):=u∈(Z/kZ)×∑∣s(u,k)∣≪k(logk)2.
Proof. Use the cotangent formula [19]s(u,k)=4k1n=1∑k−1cotkπncotkπnu, and set C(k)=∑v=1k−1∣cot(πv/k)∣.
Splitting the range at k/2 and using
∣cotx∣≪1/x near 0 gives C(k)≪klogk. For fixed n, put δ=(n,k) and q=k/δ. As u ranges over (Z/kZ)× the
residues numodk are nonzero
multiples δr with (r,q)=1, each with multiplicity at most δ, so u∈(Z/kZ)×∑cotkπnu≤δ1≤r<q(r,q)=1∑cotqπr≤δC(q)≪klogk. Hence M1(k)≤4k1(n=1∑k−1cotkπn)⋅O(klogk)≪k(logk)2. ◻
Proof. The k=1 terms
vanish. Fix k≥2, put β=b2modk, and define fk(a)=s(βa,k) and g(a)=⌊(b−1)/a⌋. Since k<b and b
is prime, β is a unit modulo k. The k-slice of Rb(k) is Tk=k<a≤b−1(a,k)=1∑g(a)fk(a). The function fk is periodic modulo k, and over a complete reduced residue system
its sum is zero, ∑ρ∈(Z/kZ)×fk(ρ)=∑us(u,k)=0
by reflection. Therefore any interval of integers decomposes into
complete periods, which contribute zero, and at most two incomplete
periods. Hence every interval partial sum satisfies Isupa∈I(a,k)=1∑fk(a)≤2M1(k). Since g is nonincreasing on a>k, g(k+1)≪b/k, and its total variation on (k,b] is at most g(k+1), Abel summation gives ∣Tk∣≪kbM1(k). Using
Lemma 27, ∣Tk∣≪b(logk)2. The
definition of Rb(k) contributes the
fixed factor 8, and summing over 2≤k≤b−1 gives Rb(k)≪bk≤b∑(logk)2≪b2(logb)2. ◻
Theorem 29 (Cubic law for digit-collision energy).
For odd primes b, Eb=b3+O(b2(logb)2).
More precisely, Eb=31b3+32b3+O(b2(logb)2), where the first term is
the diagonal pole and the second is the off-diagonal pole.
Proof. Proposition 23 together
with Lemmas 24, 25, 26 and Proposition 28 gives Offb=32b3+O(b2(logb)2). Adding the exact diagonal Δb=31b3+O(b2) from
Proposition 20 proves the
theorem. ◻
Remark 30 (Lower-order contributions). The asymptotic Eb∼b3 and the split 31+32 are unconditional. The
proof uses exact finite identities and Rademacher reciprocity. It then
uses Σ=1, Abel summation, and the
first-moment bound in Lemma 27. The proved O(b2(logb)2) scale contains two discrete
losses. One is the floor defect in the off-diagonal main term. The other
is the surviving k-modulus remainder.
Determining the secondary term requires their combined contribution.
Remark 31 (Energy-pole interpretation). The word “pole”
refers here to a cubic leading contribution. The diagonal is the
ratio-one contribution k=u, with the
exact rational value in Proposition 20. The
off-diagonal pairs the two orientations of every reduced ratio k=u. The cubic law gives b3Δb⟶31,b3Offb⟶32 as b tends to infinity through odd primes. These
limits do not assert a 1:2 ratio at a
fixed base. The coprime Euler sum Σ=1 fixes the off-diagonal leading
constant.
Character-Moment Form
The Dedekind proof reads the energy additively. The
primitive-character factorization gives a second exact reading. In the
character basis, modular inversion becomes conjugation and the cubic law
becomes a weighted moment of L(1,χ).
Proposition 32 rewrites the exact
Bernoulli moment proved above in the short-window normalization supplied
by Lemma 5. Inserting the
cubic theorem gives the asymptotic below.
Proposition 32 (Character-moment form). For odd
primes b, with Sχ=∑w=1b−1χ(w), Eb=π2(b−1)4bχmodb2primitiveχ(−1)=−1∑∣L(1,χ)∣2∣Sχ∣2.
Proof. Corollary 12
gives the corresponding moment in ∣B1,χ(b2)∣2. For a primitive odd character modulo
b2, the functional equation and ∣τ(χ)∣=b give [12, 20]B1,χ(b2)2=π2b2∣L(1,χ)∣2. Conjugation permutes
the primitive odd characters and preserves ∣Sχ∣. Since φ(b2)=b(b−1), the stated identity
follows. ◻
Corollary 33 (L(1)-weighted window moment). For odd
primes b, χmodb2primitiveχ(−1)=−1∑∣L(1,χ)∣2∣Sχ∣2=4π2(b−1)b2+O(b2(logb)2).
Proposition 34 (Spectral pole split). Expanding
∣Sχ∣2=v,w=1∑b−1χ(v)χ(w)
splits the spectral energy into a window diagonal v=w and a window off-diagonal v=w. The diagonal contributes 31b3+O(b2), while the
off-diagonal contributes 32b3+O(b2(logb)2).
Proof. The diagonal part is φ(b2)4(b−1)χmodb2primitiveχ(−1)=−1∑B1,χ(b2)2. The sawtooth expansion and
character orthogonality identify the corresponding all-odd expression
with 4(b−1)s(1,b2), where
s is the unit part of the
Dedekind sum. The nonunit indices are a=jb, so s(1,b2)=s(1,b2)−s(1,b). Since
s(1,b)=O(b), restoring these indices
changes the diagonal by O(b2).
It remains to remove the odd characters induced from modulus b. If χ
is induced from ψmodb, then B1,χ(b2)=b21r=1∑b−1t=0∑b−1(r+bt)ψ(r)=b1r=1∑b−1rψ(r)+2b−1r=1∑b−1ψ(r)=B1,ψ(b). The second sum vanishes because the odd character
ψ is nonprincipal. There are O(b) such characters and ∣B1,ψ(b)∣=O(b). Their
total contribution is therefore φ(b2)4(b−1)O(b3)=O(b2).
Finally, 4(b−1)s(1,b2)=3b2(b−1)(b2−1)(b2−2)=31b3+O(b2). Thus the primitive spectral diagonal is
31b3+O(b2). Subtracting it from
Theorem 29 gives the off-diagonal term. ◻
The Cubic Law
The starting observable is classical coordinate agreement. What
changes here is the question asked of it. Instead of following one
reciprocal orbit, the complete prime-square table collects every unit
multiplier, centers each residue-class fiber, and measures the total
square mass. Its finite boundary has a signed character flux. The
primitive odd transform factors into that flux and a universal Bernoulli
response, and Parseval returns the exact square mass.
At lag one in prime base, the same square mass is a centered
carry-table variance and a weighted Dedekind average. Summing the
collision ratios removes the Dedekind weight. The ratio-one diagonal is
exact. Rademacher reciprocity pairs the off-diagonal ratios, and the
coprime Euler sum fixes their leading constant. The result is Eb=4vmodb2(v,b)=1∑wb(v)s(v,b2)=b3+O(b2(logb)2). The continuous scale,
the Dedekind machinery, and the L(1)
machinery are classical. The finite conclusion is the exact
collision-energy dictionary and the persistence of that scale on the
complete prime-square carry table, with one third of the leading mass on
the ratio-one diagonal and two thirds on the coprime off-diagonal. The
same split appears in the primitive-character moment.
The floor defect and the surviving k-modulus remainder determine the lower-order
structure. Their combined coefficient requires a sharper estimate than
the cubic theorem supplies. The leading constant, by contrast, is fixed
completely by the exact ratio-one evaluation and the unit coprime Euler
mass.
References
[1]T. M. Apostol, Modular Functions and Dirichlet Series in Number Theory, 2nd ed., Graduate Texts in Mathematics 41, Springer, New York, 1990.
[2]B. C. Berndt, Character analogues of the Poisson and Euler–Maclaurin summation formulas with applications, J. Number Theory7 (1975), 413–445.
[3]S. Bettin and J. B. Conrey, Period functions and cotangent sums, Algebra Number Theory7 (2013), no. 1, 215–242.
[4]B. Borda, M. Munsch, and I. E. Shparlinski, Pointwise and correlation bounds on Dedekind sums over small subgroups, Res. Number Theory10 (2024), no. 2, article 28. doi:10.1007/s40993-024-00514-9.
[5]J. B. Conrey, E. Fransen, R. Klein, and C. Scott, Mean values of Dedekind sums, J. Number Theory56 (1996), no. 2, 214–226.
[6]H. Davenport, Multiplicative Number Theory, 3rd ed., revised by H. L. Montgomery, Graduate Texts in Mathematics 74, Springer, New York, 2000.
[7]P. Flajolet and B. Salvy, Euler sums and contour integral representations, Experiment. Math.7 (1998), no. 1, 15–35.
[10]K. Girstmair, Mean values and variances of the digits of 1/p, arXiv:2606.29930, 2026.
[11]T. Hilberdink, F. Luca, and L. Tóth, On certain sums concerning the gcd's and lcm's of k positive integers, Int. J. Number Theory16 (2020), no. 1, 77–90. https://doi.org/10.1142/S1793042120500049
[12]H. Iwaniec and E. Kowalski, Analytic Number Theory, American Mathematical Society Colloquium Publications 53, Amer. Math. Soc., Providence, RI, 2004.
[14]A. Lempel and H. Greenberger, Families of sequences with optimal Hamming-correlation properties, IEEE Trans. Inform. Theory20 (1974), no. 1, 90–94. https://doi.org/10.1109/TIT.1974.1055169
[15]S. R. Louboutin and M. Munsch, Mean square values of L-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
[16]Paolo Minelli, Athanasios Sourmelidis, and Marc Technau, On restricted averages of Dedekind sums, Int. Math. Res. Not. IMRN (2024), no. 10, 8485–8502. doi:10.1093/imrn/rnad283.