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 b^2. After its residue-class means are removed, let E_b be the resulting centered square mass. We prove E_b=b^3+O\!\left(b^2(\log b)^2\right), with diagonal and off-diagonal leading terms \tfrac13 b^3 and \tfrac23 b^3. 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 E_b 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 E_b. The size of E_b 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_{\ell,b}=\bigl\{\,0\le n<b^{\ell+1}\ :\ \lfloor n/b^{\ell}\rfloor\equiv n\pmod b\,\bigr\}, the set of (\ell+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 b^2, 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 \sum_{r,s\le N}\frac{(r,s)^2}{rs}=3N+O((\log N)^2). This sum is three times the continuous square mass of 2\sum_{r\le 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 E_b defined by the threshold carry table in Section 3, E_b=b^3+O\!\left(b^2(\log b)^2\right), and the leading term splits as a diagonal contribution \tfrac13 b^3 and an off-diagonal contribution \tfrac23 b^3. 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 b^2 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,\chi) 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 is the character transform of the digit boundary. The diagonal gives the finite setting. The asymptotic proof begins with the lag-one carry table.
Fix b\ge 2, \ell\ge 1, and m=b^{\ell+1}. For a residue n\bmod m, write its (\ell+1)-digit base-b expansion with leading zeros allowed. The lag-\ell collision condition compares the leading and trailing digits of this word, and therefore forces the finite diagonal G_{\ell,b}=\bigl\{\,0\le n<m\ :\ \lfloor n/b^{\ell}\rfloor\equiv n\pmod b\,\bigr\}.
Remark 1 (Finite collision diagonal). The integer n records the residue of the relevant scaled remainder modulo m. Writing n=d_\ell b^\ell+\cdots+d_1b+d_0,\qquad 0\le d_i<b, the leading digit is d_\ell=\lfloor n/b^\ell\rfloor, while the trailing digit is d_0\equiv n\pmod b. Same-bin membership is therefore the equality d_\ell=d_0, which is exactly the displayed congruence defining G_{\ell,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.
For a Dirichlet character \chi modulo q, write B_{1,\chi}^{(q)}=\frac1q\sum_{a=1}^{q-1}\chi(a)a. When the modulus is fixed by context, write B_{1,\chi}. We use the standard sawtooth notation ((x))=\{x\}-\frac12 for nonintegral x, with ((x))=0 for integral x.
The Fourier convention is \widehat f(\chi)=\frac1{\varphi(m)} \sum_{x\in(\mathbb{Z}/m\mathbb{Z})^\times}f(x)\overline{\chi(x)}.
Lemma 2 (Odd sawtooth expansion). Let q\ge2. For (a,q)=1, \Bigl(\!\Bigl(\frac aq\Bigr)\!\Bigr) =\frac1{\varphi(q)} \sum_{\substack{\chi\bmod q\\\chi(-1)=-1}}B_{1,\overline\chi}\,\chi(a).
Proof. On the finite group (\mathbb{Z}/q\mathbb{Z})^\times, expand ((a/q))=\sum_\chi \lambda_\chi\chi(a). Orthogonality gives \lambda_\chi=\frac1{\varphi(q)} \sum_{(a,q)=1}\Bigl(\!\Bigl(\frac aq\Bigr)\!\Bigr)\overline{\chi(a)}. For nonprincipal \chi, the constant part of ((a/q))=a/q-\tfrac12 sums to zero, so \sum_{(a,q)=1}\Bigl(\!\Bigl(\frac aq\Bigr)\!\Bigr)\overline{\chi(a)} =\frac1q\sum_{a=1}^{q-1}\overline\chi(a)a =B_{1,\overline\chi}. 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 B_{1,\overline\chi} appears in the coefficient with the Fourier convention above; square masses are unchanged because B_{1,\overline\chi}=\overline{B_{1,\chi}}.
For the lag-one diagonal G=G_{1,b}=\{r(b+1):0\le r\le b-1\}, write S_G(\chi)= \sum_{r=0}^{b-1}\bigl(\chi(r(b+1)+1)-\chi(r(b+1))\bigr).
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 \chi\bmod b^2 be odd and induced from a character modulo b. Then S_\chi:=\sum_{k=1}^{b-1}\chi(k)=0. Consequently, the lag-one boundary flux also vanishes. S_G(\chi)=0 .
Proof. The values 1,\ldots,b-1 form the complete reduced residue system modulo b, so S_\chi=0 by character orthogonality for the nonprincipal character inducing \chi. Since \chi is odd, Lemma 5 gives S_G(\chi)=-2\chi(b+1)S_\chi=0. ◻
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=(\mathbb{Z}/m\mathbb{Z})^\times. For every function S^\circ\colon U\to\mathbb C, the Fourier convention above gives \sum_{x\in U}|S^\circ(x)|^2 = \varphi(m)\sum_{\chi\bmod m}|\widehat{S^\circ}(\chi)|^2 .
Proof. Fourier inversion on U gives S^{\circ}(x)=\sum_{\chi\bmod m}\widehat{S^{\circ}}(\chi)\chi(x), \qquad \widehat{S^{\circ}}(\chi)=\frac1{\varphi(m)} \sum_{x\in U}S^{\circ}(x)\overline{\chi(x)} . Orthogonality on U gives the square-mass identity \sum_{x\in U}|S^{\circ}(x)|^2 =\varphi(m)\sum_{\chi\bmod m}|\widehat{S^{\circ}}(\chi)|^2 . ◻
Lemma 5 (Lag-one boundary reduction). Let m=b^2, G=G_{1,b}=\{r(b+1):0\le r\le b-1\}, and extend Dirichlet characters by zero on nonunits. For every odd character \chi\bmod b^2, S_G(\chi) =-2\,\chi(b+1)\sum_{k=1}^{b-1}\chi(k). Consequently, if S_\chi=\sum_{k=1}^{b-1}\chi(k), then |S_G(\chi)|^2=4|S_\chi|^2.
Proof. Write S_G(\chi)=Q-\alpha P,\qquad \alpha=\chi(b+1),\qquad P=\sum_{k=1}^{b-1}\chi(k), where Q=\sum_{r=0}^{b-2}\chi(r(b+1)+1). The n-terms give \alpha P, because \chi(r(b+1))=\chi(b+1)\chi(r), with both sides zero when r is not a unit. The n+1-term at r=b-1 is \chi(b^2)=0, which is why Q stops at b-2.
The reflection b^2-\bigl(r(b+1)+1\bigr)=(b-1-r)(b+1) maps r=0,\ldots,b-2 bijectively to j=1,\ldots,b-1. Since \chi is odd, \chi(b^2-a)=-\chi(a), and therefore -Q=\sum_{j=1}^{b-1}\chi(j(b+1)) =\alpha\sum_{j=1}^{b-1}\chi(j)=\alpha P. Thus Q=-\alpha P, so S_G(\chi)=-2\alpha P. Since b+1 is a unit modulo b^2, |\chi(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 b^2.
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 a\bmod b^2 is represented by the unique integer 1\le a<b^2 with (a,b)=1.
The raw lag-one table follows unit multiples of the two-digit diagonal. Write a residue n\bmod b^2 as n=bq+r, 0\le q,r<b. The collision diagonal is G_{1,b}=\{(b+1)d:0\le 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. I_d(a)= \mathbf 1\!\left[(b+1)da\bmod b^2\ge b^2-a\right]. Equivalently, I_d(a)= \left\lfloor\frac{((b+1)d+1)a}{b^2}\right\rfloor - \left\lfloor\frac{(b+1)da}{b^2}\right\rfloor . Thus the row sum of this explicit collision table is the finite threshold-crossing count f_b(a)=\#\bigl\{\,0\le d\le b-1\ :\ (b+1)\,d\,a\bmod b^{2}\ \ge\ b^{2}-a\,\bigr\}, and the centered row statistic is S_1(a)=f_b(a)-1-\Bigl\lfloor\tfrac{a-1}{b}\Bigr\rfloor,\qquad V_b=\sum_{\substack{a\bmod b^2\\(a,b)=1}}S_1(a)^2 . The prime-base lag-one collision energy is the class-centered square mass E_b=V_b-\frac{(b-1)(2b-1)}6 . Equivalently, if \overline S_s is the mean of S_1(bq+s) over 0\le q<b, then \overline S_s=-(b-s)/b, and E_b=\sum_{s=1}^{b-1}\sum_{q=0}^{b-1} \bigl(S_1(bq+s)-\overline S_s\bigr)^2 . Finally set T_b(a)=2f_b(a)-2\!\left(1+\Bigl\lfloor\tfrac{a-1}{b}\Bigr\rfloor\right)+1 . Thus T_b(a)=2S_1(a)+1. The centered square mass of T_b is the half-centered table-side form of the collision energy.
The units modulo 9 are 1,2,4,5,7,8. In that order, the six threshold counts and their class-centered values are \begin{array}{c|rrrrrr} a&1&2&4&5&7&8\\ f_3(a)&1&2&2&1&1&2\\ S_1(a)-\overline S_{a\bmod3} &\tfrac23&\tfrac43&\tfrac23&-\tfrac23&-\tfrac43&-\tfrac23 \end{array} and hence E_3=\sum_{a\in(\mathbb{Z}/9\mathbb{Z})^\times} \bigl|S_1(a)-\overline S_{a\bmod3}\bigr|^2=\frac{16}{3}. 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\le s\le b-1. Then \sum_{q=0}^{b-1}f_b(bq+s)=\frac{b(b-1)}2+s, \qquad \overline S_s:=\frac1b\sum_{q=0}^{b-1}S_1(bq+s)=-\frac{b-s}{b}. Consequently \sum_{s=1}^{b-1}b\,\overline S_s^{\,2} =\frac{(b-1)(2b-1)}6, and E_b=\sum_{s=1}^{b-1}\sum_{q=0}^{b-1} \bigl(S_1(bq+s)-\overline S_s\bigr)^2 .
Proof. Two elementary floor identities are used. If (m,b)=1 and K\in\mathbb{Z}, then \sum_{q=0}^{b-1}\Bigl\lfloor\frac{mq+K}{b}\Bigr\rfloor =\frac{(m-1)(b-1)}2+K, because the residues mq+K\bmod b run once through 0,\ldots,b-1. For any integer m\ge0 and 0\le s<b, \Bigl\lfloor\frac{m(bq+s)}{b^2}\Bigr\rfloor = \Bigl\lfloor\frac{mq+\lfloor ms/b\rfloor}{b}\Bigr\rfloor . The threshold indicator has the floor-difference form \mathbf 1[(y\bmod b^2)\ge b^2-a] = \Bigl\lfloor\frac{y+a}{b^2}\Bigr\rfloor - \Bigl\lfloor\frac{y}{b^2}\Bigr\rfloor , with y=(b+1)da. Therefore, for a=bq+s, f_b(a)=\sum_{d=0}^{b-1} \left( \Bigl\lfloor\frac{((b+1)d+1)a}{b^2}\Bigr\rfloor - \Bigl\lfloor\frac{(b+1)d\,a}{b^2}\Bigr\rfloor \right). For d=0, this contribution is 0 for every q. For 1\le d\le b-2, both multipliers (b+1)d and (b+1)d+1 are units modulo b, and their contribution to \sum_q f_b(bq+s) is \frac{b-1}2+ \left( \Bigl\lfloor\frac{((b+1)d+1)s}{b}\Bigr\rfloor - \Bigl\lfloor\frac{(b+1)d\,s}{b}\Bigr\rfloor \right) = \frac{b-1}2+\varepsilon_d, where \varepsilon_d=\mathbf 1[(ds\bmod b)+s\ge b]. For d=b-1, the upper multiplier is b^2, and the lower multiplier is b^2-1. The same calculation gives contribution b.
As d runs over 1,\ldots,b-1, the residue ds\bmod b runs over 1,\ldots,b-1, and exactly s of these residues are at least b-s. Since \varepsilon_{b-1}=1, the partial sum over 1\le d\le b-2 is s-1. Hence \sum_{q=0}^{b-1}f_b(bq+s) =(b-2)\frac{b-1}2+(s-1)+b =\frac{b(b-1)}2+s . It follows that \sum_{q=0}^{b-1}S_1(bq+s) =\frac{b(b-1)}2+s-b-\frac{b(b-1)}2=s-b, so \overline S_s=-(b-s)/b. The square-mean identity follows by summing b(b-s)^2/b^2 over s, and expanding the doubly centered mass gives V_b-\sum_s b\,\overline S_s^{\,2}=E_b. ◻
Definition 8 (Centered collision function). For an odd prime b, define S^\circ on (\mathbb{Z}/b^2\mathbb{Z})^\times by S^\circ(a)=S_1(a)-\overline S_{a\bmod b}, using the least positive representative 1\le a<b^2, and extend it by zero to nonunits. Lemma 7 gives \sum_{a\in(\mathbb{Z}/b^2\mathbb{Z})^\times}|S^\circ(a)|^2=E_b .
Lemma 9 (Primitive floor transform). Let \chi be a primitive odd character modulo b^2, and let m be an integer with 1\le m<b^2 and (m,b)=1. Then \sum_{\substack{a\bmod b^2\\(a,b)=1}} \Bigl\lfloor\frac{ma}{b^2}\Bigr\rfloor\overline\chi(a) = \bigl(m-\chi(m)\bigr)B_{1,\overline\chi}^{(b^2)} .
Proof. For a unit a, the quotient ma/b^2 is not an integer, so \Bigl\lfloor\frac{ma}{b^2}\Bigr\rfloor = \frac{ma}{b^2} - \Bigl(\!\Bigl(\frac{ma}{b^2}\Bigr)\!\Bigr) -\frac12 . The constant term drops after summing against \overline\chi. The linear part gives \frac{m}{b^2}\sum_a a\overline\chi(a)=mB_{1,\overline\chi}^{(b^2)}. For the sawtooth part, substitute a\mapsto m^{-1}a and apply Lemma 2. \sum_a \Bigl(\!\Bigl(\frac{ma}{b^2}\Bigr)\!\Bigr)\overline\chi(a) = \chi(m)\sum_a \Bigl(\!\Bigl(\frac{a}{b^2}\Bigr)\!\Bigr)\overline\chi(a) = \chi(m)B_{1,\overline\chi}^{(b^2)}. Subtracting gives the identity. ◻
Theorem 10 (Lag-one collision factorization). Let b be an odd prime and let \chi be a primitive odd character modulo b^2. Then \widehat{S^\circ}(\chi) = \frac1{\varphi(b^2)} \sum_{\substack{a\bmod b^2\\(a,b)=1}}S^\circ(a)\overline\chi(a) = -\,\frac{B_{1,\overline\chi}^{(b^2)}\,S_G(\chi)}{\varphi(b^2)} .
Proof. The centering constant contributes nothing, since \sum_{a\equiv s\,(b)}\overline\chi(a)=0 for primitive \chi. Indeed, a nonzero fiber sum would make \chi trivial on the kernel of (\mathbb{Z}/b^2\mathbb{Z})^\times\to(\mathbb{Z}/b\mathbb{Z})^\times, forcing \chi to descend to modulus b. Thus \sum_a S^\circ(a)\overline\chi(a)=\sum_a S_1(a)\overline\chi(a). The constant term in S_1(a)=f_b(a)-1-\lfloor(a-1)/b\rfloor vanishes by nonprincipality. On units, \lfloor(a-1)/b\rfloor=\lfloor a/b\rfloor, and the sawtooth part of \lfloor a/b\rfloor depends only on a\bmod b, so its primitive character sum vanishes. Hence \sum_a\Bigl\lfloor\frac{a-1}{b}\Bigr\rfloor\overline\chi(a) = bB_{1,\overline\chi}^{(b^2)}.
For f_b, use the floor-difference formula from Lemma 7 with multipliers m_d^+=(b+1)d+1 and m_d^-=(b+1)d. The exceptional terms are m_0^-=0, which contributes 0, and m_{b-1}^+=b^2, whose floor is a and therefore contributes b^2B_{1,\overline\chi}^{(b^2)}. Lemma 9 gives all remaining terms, so \begin{aligned} \sum_a f_b(a)\overline\chi(a) &= b^2B_{1,\overline\chi}^{(b^2)}\\ &\quad+ B_{1,\overline\chi}^{(b^2)} \left[ \sum_{d=0}^{b-2}\bigl(m_d^+-\chi(m_d^+)\bigr) - \sum_{d=1}^{b-1}\bigl(m_d^--\chi(m_d^-)\bigr) \right]. \end{aligned} The integer parts satisfy \sum_{d=0}^{b-2}m_d^+-\sum_{d=1}^{b-1}m_d^-=-b(b-1), so their net contribution with the exceptional term is bB_{1,\overline\chi}^{(b^2)}. For the character parts, \sum_{d=0}^{b-2}\chi(m_d^+)-\sum_{d=1}^{b-1}\chi(m_d^-) = Q-\chi(b+1)S_\chi = -2\chi(b+1)S_\chi = S_G(\chi), using Lemma 5. Therefore \sum_a f_b(a)\overline\chi(a) = bB_{1,\overline\chi}^{(b^2)} - B_{1,\overline\chi}^{(b^2)}S_G(\chi). Subtracting the \lfloor(a-1)/b\rfloor contribution cancels the bB_{1,\overline\chi}^{(b^2)} term and leaves \sum_a S_1(a)\overline\chi(a) = -B_{1,\overline\chi}^{(b^2)}S_G(\chi). Dividing by \varphi(b^2) proves the theorem. ◻
Lemma 11 (Carry-table reflection law). Let a be a unit represented by 1\le a<b^2, and put a^\ast=b^2-a. Then f_b(a)+f_b(a^\ast)=b,\qquad T_b(a^\ast)=-T_b(a), and S^\circ(b^2-a)=-S^\circ(a).
Proof. Put x_d=(b+1)da\bmod b^2. For a^\ast=b^2-a, the reflected residue is -x_d\bmod b^2. The term d=0 contributes to neither threshold. For 1\le d\le b-1, the two threshold indicators sum to 1+\mathbf 1[x_d=b^2-a]. The congruence x_d=b^2-a is equivalent to (b+1)d\equiv -1\bmod b^2, whose unique solution in 1\le d\le b-1 is d=b-1. Hence f_b(a)+f_b(a^\ast)=b.
If a=bq+s, 1\le s<b, then a^\ast=b(b-1-q)+(b-s), so S_1(a)+S_1(a^\ast) =f_b(a)+f_b(a^\ast)-1-q-1-(b-1-q)=-1. Equivalently, T_b(a^\ast)=-T_b(a). Since \overline S_s+\overline S_{b-s}=-1, the centered function satisfies S^\circ(a)+S^\circ(a^\ast) = S_1(a)+S_1(a^\ast)-\overline S_s-\overline S_{b-s}=0. ◻
Corollary 12 (Lag-one spectral energy formula). For odd primes b, with S_\chi=\sum_{k=1}^{b-1}\chi(k), E_b=\frac{4}{\varphi(b^2)} \sum_{\substack{\chi\bmod b^2\ \mathrm{primitive}\\\chi(-1)=-1}} |B_{1,\chi}^{(b^2)}|^2\,|S_\chi|^2 .
Proof. Lemma 11 gives S^\circ(b^2-a)=-S^\circ(a), so even characters vanish. If \chi is imprimitive modulo b^2, induced from modulus b, then \chi is constant on each residue class modulo b, and the class-centering gives \sum_{\substack{a\bmod b^2\\(a,b)=1}}S^\circ(a)\overline{\chi(a)} = \sum_{s=1}^{b-1}\overline{\chi(s)} \sum_{q=0}^{b-1}S^\circ(bq+s)=0 . Thus the imprimitive sector vanishes directly from the table centering. Parseval on (\mathbb{Z}/b^2\mathbb{Z})^\times, together with Definition 8 and Theorem 10, gives E_b = \varphi(b^2) \sum_{\chi\ \mathrm{primitive\ odd}} |\widehat{S^\circ}(\chi)|^2 = \frac1{\varphi(b^2)} \sum_{\chi\ \mathrm{primitive\ odd}} |B_{1,\chi}^{(b^2)}|^2|S_G(\chi)|^2. Finally, |S_G(\chi)|^2=4|S_\chi|^2 by Lemma 5. ◻
Theorem 13 (Threshold-energy normalization). For odd prime b, the lag-one threshold variance satisfies V_b=\sum_{\substack{a\bmod b^{2}\\(a,b)=1}}\left(f_b(a)-1-\Bigl\lfloor\tfrac{a-1}{b}\Bigr\rfloor\right)^{2}. With T_b(a)=2S_1(a)+1, one has the exact normalizations V_b=\frac14\sum_{\substack{a\bmod b^{2}\\(a,b)=1}}T_b(a)^2+\frac14b(b-1), and E_b=\frac14\sum_{\substack{a\bmod b^{2}\\(a,b)=1}}T_b(a)^2-\frac{(b-1)(b-2)}{12}.
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)da\bmod b^2\ge b^2-a . Thus f_b(a) is the number of diagonal steps whose translate crosses the right endpoint of the a-window. The deterministic block count is \mu_b(a)=1+\Bigl\lfloor\tfrac{a-1}{b}\Bigr\rfloor, the number of base-b blocks met by the interval of length a, including its final partial block. Hence the threshold variance is V_b=\sum_{(a,b)=1}\bigl(f_b(a)-\mu_b(a)\bigr)^2 . The class-centering correction enters later through the means \overline S_s. The half-centered integer normalization satisfies T_b(a)=2\bigl(f_b(a)-\mu_b(a)\bigr)+1, so T_b(a)=2S_1(a)+1. The reflection a^\ast=b^2-a gives T_b(a^\ast)=-T_b(a) by Lemma 11. Since S_1(a)^2=\frac14T_b(a)^2-\frac12T_b(a)+\frac14, the linear term cancels after summing over reflection pairs of units, and \sum_{(a,b)=1}S_1(a)^2 =\frac14\sum_{(a,b)=1}T_b(a)^2+\frac14\varphi(b^2). Thus V_b=\frac14\sum_{(a,b)=1}T_b(a)^2+\frac14b(b-1). The class-centering correction is exact. E_b=V_b-\frac{(b-1)(2b-1)}6 . Indeed, \overline S_s=-(b-s)/b, so \sum_{s=1}^{b-1}b\,\overline S_s^{\,2} =\frac1b\sum_{s=1}^{b-1}(b-s)^2 =\frac{(b-1)(2b-1)}6 . Consequently E_b=\frac14\sum_{(a,b)=1}T_b(a)^2 +\frac14b(b-1)-\frac{(b-1)(2b-1)}6, or, in compact form, E_b=\frac14\sum_{(a,b)=1}T_b(a)^2 -\frac{(b-1)(b-2)}{12}. Thus the difference between E_b and \frac14\sum T_b(a)^2 is O(b^2) with a displayed closed form. ◻
Theorem 13 shows that the cubic energy law is equivalent to \sum_{(a,b)=1}T_b(a)^2 =4b^3+O\!\left(b^2(\log b)^2\right).
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 v\bmod b^2 is counted exactly as many times as there are window entries k for which kv lands back in the first digit window \{1,\ldots,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))=\begin{cases}\{x\}-\tfrac12,&x\notin\mathbb{Z},\\0,&x\in\mathbb{Z},\end{cases}\qquad s(h,m)=\sum_{a=1}^{m-1}\Bigl(\!\Bigl(\tfrac am\Bigr)\!\Bigr)\Bigl(\!\Bigl(\tfrac{ha}{m}\Bigr)\!\Bigr).
Definition 15 (Collision weight). For a unit v modulo b^{2} define w_b(v)=\#\bigl\{\,1\le k\le b-1\ :\ vk\bmod b^{2}\in\{1,\dots,b-1\}\,\bigr\}. Writing v=\alpha+b\beta with 1\le\alpha\le b-1, this is w_b(\alpha+b\beta)=\#\Bigl\{\,1\le k\le b-1\ :\ \beta k+\bigl\lfloor \alpha k/b\bigr\rfloor\equiv 0\pmod b\,\Bigr\}.
Theorem 16 (Weighted Dedekind identity). For odd prime b, the prime-base lag-one energy satisfies E_b=\frac1{b^{2}}\sum_{\substack{v\bmod b^{2}\\(v,b)=1}}w_b(v)\Bigl(4b^{2}\,s(v,b^{2})-4b\,s(v\bmod b,\,b)\Bigr). The mod-b correction cancels after weighting, so E_b=4\sum_{\substack{v\bmod b^{2}\\(v,b)=1}}w_b(v)\,s(v,b^{2}).
Proof. Put q=b^2. By the lag-one spectral energy identity, Corollary 12, E_b=\frac{4}{\varphi(q)} \sum_{\substack{\chi\bmod q\ {\rm primitive}\\ \chi(-1)=-1}} |B_{1,\chi}|^2\,|S_\chi|^2,\qquad S_\chi=\sum_{k=1}^{b-1}\chi(k). Imprimitive odd characters modulo q are induced from modulus b, and the window sum S_\chi 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 \chi\bmod q, put C_\chi=\sum_{\substack{u\bmod q\\(u,q)=1}} \overline\chi(u)\cot\frac{\pi u}{q}. With \tau(\chi)=\sum_{a\bmod q}\chi(a)e^{2\pi i a/q}, the standard finite cotangent transform [19, 20] gives, for primitive odd \chi, C_\chi =2i\,\tau(\overline\chi)B_{1,\chi} =-\frac{2iq}{\tau(\chi)}B_{1,\chi}. Since \lvert\tau(\chi)\rvert=\sqrt q, 4q\,|B_{1,\chi}|^2=|C_\chi|^2 and hence, since q=b^2, qE_b = \frac1{\varphi(q)} \sum_{\substack{\chi\bmod q\ {\rm primitive}\\ \chi(-1)=-1}} |C_\chi|^2|S_\chi|^2 . On the other hand, define K(u)=\sum_{k=1}^{b-1} \cot\frac{\pi(uk^{-1}\bmod q)}{q}. The function K(u) is real-valued, and multiplicative Parseval on (\mathbb{Z}/q\mathbb{Z})^\times gives \sum_{\substack{u\bmod q\\(u,b)=1}}|K(u)|^2 = \frac1{\varphi(q)} \sum_{\chi\bmod q}|C_\chi|^2|S_\chi|^2 . Indeed, the \chi-coefficient of K is \frac1{\varphi(q)}\sum_{u}K(u)\overline\chi(u) = \frac1{\varphi(q)} \left(\sum_{k=1}^{b-1}\overline\chi(k)\right)C_\chi . Even characters have C_\chi=0, and imprimitive odd characters have S_\chi=0, so the full character sum reduces to the primitive odd sum above. Thus b^2E_b = \sum_{\substack{u\bmod q\\(u,b)=1}}|K(u)|^2 . Expanding this square gives a sum over pairs k,\ell\in\{1,\ldots,b-1\}. After the change of variables x=uk^{-1} and v\equiv k\ell^{-1}\pmod q, this becomes \sum_{\substack{u\bmod q\\(u,b)=1}}|K(u)|^2 = \sum_{\substack{v\bmod q\\(v,b)=1}}w_b(v)\,\Gamma(v), where \Gamma(v)= \sum_{\substack{u\bmod q\\(u,b)=1}} \cot\frac{\pi u}{q}\cot\frac{\pi uv}{q}. The multiplicity of a given ratio v is exactly w_b(v), because it counts the first-window entries r for which vr\bmod q is again in the first window.
It remains to evaluate \Gamma(v). The classical cotangent-Dedekind identity \sum_{a=1}^{m-1}\cot\frac{\pi a}{m}\cot\frac{\pi ha}{m} =4m\,s(h,m) gives 4q\,s(v,q) when summed over all 1\le u<q. The excluded nonunits are u=bt, 1\le t<b, and their contribution is \sum_{t=1}^{b-1} \cot\frac{\pi t}{b}\cot\frac{\pi(v\bmod b)t}{b} =4b\,s(v\bmod b,b). Thus \Gamma(v)=4b^2s(v,b^2)-4b\,s(v\bmod b,b), and division by b^2 gives the first displayed identity.
For the correction term, write v=\alpha+b\beta. For fixed \alpha, \sum_{\beta\bmod b}w_b(\alpha+b\beta)=b-1. Indeed, for each 1\le k<b the congruence \beta k+\bigl\lfloor\alpha k/b\bigr\rfloor\equiv0\pmod b has a unique solution \beta\bmod b, since k is a unit modulo b. Thus the correction contributes (b-1)\sum_{\alpha=1}^{b-1}s(\alpha,b)=0, by the reflection s(-u,b)=-s(u,b). The weighted identity therefore reduces to E_b=4\sum_v w_b(v)s(v,b^2). ◻
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. \begin{aligned} E_b &=\sum_{a\in(\mathbb{Z}/b^2\mathbb{Z})^\times}|S^\circ(a)|^2\\ &=\frac{4}{\varphi(b^2)} \sum_{\substack{\chi\bmod b^2\ {\rm primitive}\\ \chi(-1)=-1}} |B_{1,\chi}^{(b^2)}|^2|S_\chi|^2\\ &=4\sum_{\substack{v\bmod b^2\\(v,b)=1}}w_b(v)s(v,b^2). \end{aligned}
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 E_b=4\sum_{k=1}^{b-1}\sum_{u=1}^{b-1}s\bigl(k^{-1}u\bmod b^{2},\,b^{2}\bigr), where k^{-1} is taken modulo b^{2}.
Proof. By definition w_b(v) counts the pairs (k,u) with 1\le k,u\le b-1 and kv\equiv u\pmod{b^{2}}. Since k is a unit modulo b^{2}, the congruence determines v\equiv k^{-1}u\pmod{b^{2}}. Substituting this parametrization into E_b=4\sum_v w_b(v)s(v,b^{2}) 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\bigl(k^{-1}u\bmod b^{2},\,b^{2}\bigr)=s\bigl(k'^{-1}u'\bmod b^{2},\,b^{2}\bigr), so each summand in Proposition 18 depends only on the reduced rational ratio u/k.
Proof. Because 1\le g<b, the integer g is a unit modulo b^{2}. Therefore (gk')^{-1}(gu')\equiv k'^{-1}u'\pmod{b^{2}}, and the Dedekind sum depends only on the residue class of its first argument modulo b^{2}. ◻
Proposition 20 (Reduced-ratio pole split). The diagonal part of the double sum is \Delta_b=4(b-1)s(1,b^{2})=\frac{(b-1)(b^{2}-1)(b^{2}-2)}{3b^{2}}=\frac13 b^{3}+O(b^{2}). The off-diagonal part is exactly \mathrm{Off}_b=8\sum_{\substack{1\le k<a\le b-1\\(a,k)=1}}\Bigl\lfloor\tfrac{b-1}{a}\Bigr\rfloor\,s\bigl(k^{-1}a\bmod b^{2},\,b^{2}\bigr), and E_b=\Delta_b+\mathrm{Off}_b.
Proof. On the diagonal u=k the residue is k^{-1}u\equiv 1\pmod{b^{2}}, which gives \Delta_b=4(b-1)s(1,b^{2}). The classical evaluation s(1,m)=(m-1)(m-2)/(12m) with m=b^{2} [19] produces the displayed closed form.
For u\ne 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\mapsto 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)=(t k',t a'),\qquad a'>k'\ge1,\qquad (a',k')=1. The condition 1\le k,u\le b-1 is then exactly 1\le t\le \Bigl\lfloor\frac{b-1}{a'}\Bigr\rfloor . Renaming (a',k') as (a,k), each reduced pair occurs with multiplicity \lfloor(b-1)/a\rfloor. The original factor 4 in the double sum and the two orientations give the factor 8. ◻
Lemma 21 (Coprime Euler sum). \Sigma:=\sum_{\substack{a>k\ge 1\\(a,k)=1}}\frac1{ka^{2}}=1.
Proof. Let H_n=\sum_{j=1}^n j^{-1}, with H_0=0. The series below are absolutely convergent, so Möbius inversion and rearrangement give \Sigma =\sum_{d\ge1}\mu(d)\sum_{a'>k'\ge1} \frac1{(dk')(da')^2} =\sum_{d\ge 1}\frac{\mu(d)}{d^{3}} \sum_{a'>k'\ge 1}\frac1{k'(a')^{2}} =\frac1{\zeta(3)}\sum_{a\ge 2}\frac{H_{a-1}}{a^{2}} . The classical Euler sum \sum_{a\ge 1}H_a/a^{2}=2\zeta(3) [7] gives \sum_{a\ge 2}\frac{H_{a-1}}{a^{2}}=\sum_{a\ge 2}\frac{H_a}{a^{2}}-\sum_{a\ge 2}\frac1{a^{3}}=\bigl(2\zeta(3)-1\bigr)-\bigl(\zeta(3)-1\bigr)=\zeta(3). Thus \Sigma=1. ◻
Lemma 22 (Rademacher reciprocity reduction). For coprime integers 1\le k<a\le b-1, \begin{aligned} s\bigl(k^{-1}a\bmod b^{2},\,b^{2}\bigr) &=\frac{b^{2}}{12ka} +\frac1{12}\Bigl(\frac{a}{kb^{2}}+\frac{k}{ab^{2}}\Bigr) -\frac14\\ &\quad -s\bigl(k\,\overline{b^{2}}^{(a)},a\bigr) -s\bigl(b^{2}\,\overline{a}^{(k)},k\bigr), \end{aligned} where \overline{b^{2}}^{(a)} is the inverse of b^{2} modulo a. For k\ge2, \overline{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,b^2) gives s(a,b^2)+s(b^2,a) =-\frac14+\frac1{12}\left(\frac{a}{b^2} +\frac{b^2}{a}+\frac1{ab^2}\right). The symmetry s(h,a)=s(h^{-1},a) identifies s(b^2,a) with s(\overline{b^2}^{(a)},a), which is the displayed formula with the final modulus-one term equal to zero.
Now suppose k\ge2. In the following display m_j^{(m_i)} denotes the inverse of m_j modulo m_i. Rademacher’s three-term reciprocity [18] (see also [19]) states that for pairwise coprime positive integers m_1,m_2,m_3, \begin{aligned} s\bigl(m_2 m_3^{(m_1)},m_1\bigr) &+s\bigl(m_3 m_1^{(m_2)},m_2\bigr) +s\bigl(m_1 m_2^{(m_3)},m_3\bigr)\\ &=-\frac14+\frac1{12}\Bigl( \frac{m_1}{m_2 m_3} +\frac{m_2}{m_3 m_1} +\frac{m_3}{m_1 m_2}\Bigr). \end{aligned} Apply this with (m_1,m_2,m_3)=(b^{2},a,k). The first term is s(k^{-1}a\bmod b^{2},b^{2}), 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 b^2/(12ka) gives \mathrm{Main}_b. The constant and tiny reciprocal terms give R_b^{(0)}. The Dedekind sum at modulus a gives R_b^{(a)}, which vanishes because the k-sum runs over a full reduced residue system modulo a. The Dedekind sum at modulus k gives R_b^{(k)}, the only surviving analytic remainder.
Proposition 23 (Four-way off-diagonal decomposition). The off-diagonal contribution decomposes exactly as \mathrm{Off}_b=\mathrm{Main}_b+R_b^{(0)}+R_b^{(a)}+R_b^{(k)}, where every displayed sum runs over a>k\ge 1, (a,k)=1, a\le b-1, and \mathrm{Main}_b=\frac{2b^{2}}{3}\sum\frac1{ka}\Bigl\lfloor\tfrac{b-1}{a}\Bigr\rfloor,\qquad R_b^{(0)}=8\sum\Bigl\lfloor\tfrac{b-1}{a}\Bigr\rfloor\!\left[\frac1{12}\Bigl(\frac{a}{kb^{2}}+\frac{k}{ab^{2}}\Bigr)-\frac14\right], R_b^{(a)}=-8\sum\Bigl\lfloor\tfrac{b-1}{a}\Bigr\rfloor s\bigl(k\,\overline{b^{2}}^{(a)},a\bigr),\qquad R_b^{(k)}=-8\sum_{\substack{k\ge2}}\Bigl\lfloor\tfrac{b-1}{a}\Bigr\rfloor s\bigl(b^{2}\,\overline{a}^{(k)},k\bigr).
Proof. Start from Proposition 20. \mathrm{Off}_b =8\sum\Bigl\lfloor\tfrac{b-1}{a}\Bigr\rfloor s(k^{-1}a\bmod b^2,b^2), where the sum is over reduced pairs a>k\ge1, a\le b-1. Substituting Lemma 22 into each summand gives 8\sum\Bigl\lfloor\tfrac{b-1}{a}\Bigr\rfloor \left[ \frac{b^2}{12ka} + \frac1{12}\left(\frac{a}{kb^2}+\frac{k}{ab^2}\right) -\frac14 -s(k\overline{b^2}^{(a)},a) -s(b^2\overline a^{(k)},k) \right]. The first term is 8\cdot\frac{b^2}{12} \sum\frac1{ka}\Bigl\lfloor\tfrac{b-1}{a}\Bigr\rfloor =\mathrm{Main}_b. The constant and reciprocal terms are R_b^{(0)}, and the two small-modulus Dedekind sums are R_b^{(a)} and R_b^{(k)}. These four collected pieces are exactly the displayed decomposition. ◻
Lemma 24 (Off-diagonal main term). \mathrm{Main}_b=\frac23 b^{3}+O\!\left(b^{2}(\log b)^{2}\right).
Proof. Put c(a)=\sum_{\substack{1\le k<a\\(k,a)=1}}\frac1k\ \le\ H_{a-1}\ \ll\ \log a . Then \mathrm{Main}_b=\frac{2b^{2}}{3}\sum_{2\le a\le b-1}\frac1a\Bigl\lfloor\tfrac{b-1}{a}\Bigr\rfloor c(a). Writing \lfloor(b-1)/a\rfloor=(b-1)/a-\{(b-1)/a\}, the principal part is \frac{2b^{2}(b-1)}{3}\sum_{a<b}\frac{c(a)}{a^{2}} . By Lemma 21, \sum_{a\ge 2}c(a)/a^{2}=1, and the tail satisfies \sum_{a\ge b}\frac{c(a)}{a^{2}}\ \ll\ \sum_{a\ge b}\frac{\log a}{a^{2}}\ \ll\ \frac{\log b}{b}, so the principal part is \tfrac23 b^{3}+O(b^{2}\log b). The floor-defect term is bounded by O\!\Bigl(b^{2}\sum_{a<b}\frac{c(a)}{a}\Bigr)=O\!\left(b^{2}(\log b)^{2}\right). ◻
Lemma 25 (Constant Rademacher remainder). R_b^{(0)}=O(b^{2}).
Proof. The bracket in R_b^{(0)} is O(1), so R_b^{(0)}\ \ll\ \sum_{a<b}\Bigl\lfloor\tfrac{b-1}{a}\Bigr\rfloor\varphi(a)\ \ll\ b\sum_{a<b}\frac{\varphi(a)}{a}\ \ll\ b^{2}. ◻
Lemma 26 (a-modulus cancellation). R_b^{(a)}=0.
Proof. Fix a. The weight \lfloor(b-1)/a\rfloor is independent of k, and as k runs through the units modulo a the residue k\,\overline{b^{2}}^{(a)} also runs through the units modulo a. Therefore \sum_{\substack{1\le k<a\\(k,a)=1}}s\bigl(k\,\overline{b^{2}}^{(a)},a\bigr)=\sum_{u\in(\mathbb{Z}/a\mathbb{Z})^{\times}}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\ge 2, M_1(k):=\sum_{u\in(\mathbb{Z}/k\mathbb{Z})^{\times}}|s(u,k)|\ \ll\ k(\log k)^{2}.
Proof. Use the cotangent formula [19] s(u,k)=\frac1{4k}\sum_{n=1}^{k-1}\cot\frac{\pi n}{k}\cot\frac{\pi nu}{k}, and set C(k)=\sum_{v=1}^{k-1}|\cot(\pi v/k)|. Splitting the range at k/2 and using |\cot x|\ll 1/x near 0 gives C(k)\ll k\log k. For fixed n, put \delta=(n,k) and q=k/\delta. As u ranges over (\mathbb{Z}/k\mathbb{Z})^{\times} the residues nu\bmod k are nonzero multiples \delta r with (r,q)=1, each with multiplicity at most \delta, so \sum_{u\in(\mathbb{Z}/k\mathbb{Z})^{\times}}\Bigl|\cot\frac{\pi nu}{k}\Bigr|\ \le\ \delta\sum_{\substack{1\le r<q\\(r,q)=1}}\Bigl|\cot\frac{\pi r}{q}\Bigr|\ \le\ \delta\,C(q)\ \ll\ k\log k. Hence M_1(k)\ \le\ \frac1{4k}\Bigl(\sum_{n=1}^{k-1}\Bigl|\cot\frac{\pi n}{k}\Bigr|\Bigr)\cdot O(k\log k)\ \ll\ k(\log k)^{2}. ◻
Proposition 28 (k-modulus remainder bound). R_b^{(k)}\ \ll\ b^{2}(\log b)^{2}.
Proof. The k=1 terms vanish. Fix k\ge 2, put \beta=b^{2}\bmod k, and define f_k(a)=s(\beta\overline a,k) and g(a)=\lfloor(b-1)/a\rfloor. Since k<b and b is prime, \beta is a unit modulo k. The k-slice of R_b^{(k)} is \mathcal T_k=\sum_{\substack{k<a\le b-1\\(a,k)=1}}g(a)f_k(a). The function f_k is periodic modulo k, and over a complete reduced residue system its sum is zero, \sum_{\rho\in(\mathbb{Z}/k\mathbb{Z})^{\times}}f_k(\rho)=\sum_{u}s(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 \sup_{I}\Bigl|\sum_{\substack{a\in I\\(a,k)=1}}f_k(a)\Bigr|\ \le\ 2M_1(k). Since g is nonincreasing on a>k, g(k+1)\ll b/k, and its total variation on (k,b] is at most g(k+1), Abel summation gives |\mathcal T_k|\ll \frac{b}{k}M_1(k). Using Lemma 27, |\mathcal T_k|\ll b(\log k)^{2}. The definition of R_b^{(k)} contributes the fixed factor 8, and summing over 2\le k\le b-1 gives R_b^{(k)}\ \ll\ b\sum_{k\le b}(\log k)^{2}\ \ll\ b^{2}(\log b)^{2}. ◻
Theorem 29 (Cubic law for digit-collision energy). For odd primes b, E_b=b^{3}+O\!\left(b^{2}(\log b)^{2}\right). More precisely, E_b=\frac13 b^{3}+\frac23 b^{3}+O\!\left(b^{2}(\log b)^{2}\right), 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 \mathrm{Off}_b=\frac23 b^{3}+O\!\left(b^{2}(\log b)^{2}\right). Adding the exact diagonal \Delta_b=\tfrac13 b^{3}+O(b^{2}) from Proposition 20 proves the theorem. ◻
Remark 30 (Lower-order contributions). The asymptotic E_b\sim b^{3} and the split \tfrac13+\tfrac23 are unconditional. The proof uses exact finite identities and Rademacher reciprocity. It then uses \Sigma=1, Abel summation, and the first-moment bound in Lemma 27. The proved O(b^2(\log b)^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\ne u. The cubic law gives \frac{\Delta_b}{b^3}\longrightarrow\frac13, \qquad \frac{\mathrm{Off}_b}{b^3}\longrightarrow\frac23 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 \Sigma=1 fixes the off-diagonal leading constant.
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,\chi).
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_\chi=\sum_{w=1}^{b-1}\chi(w), E_b=\frac{4b}{\pi^{2}(b-1)} \sum_{\substack{\chi\bmod b^{2}\ \mathrm{primitive}\\\chi(-1)=-1}} |L(1,\chi)|^{2}|S_\chi|^{2}.
Proof. Corollary 12 gives the corresponding moment in \lvert B_{1,\chi}^{(b^2)}\rvert^2. For a primitive odd character modulo b^2, the functional equation and \lvert\tau(\chi)\rvert=b give [12, 20] \bigl|B_{1,\chi}^{(b^2)}\bigr|^2 =\frac{b^2}{\pi^2}|L(1,\overline\chi)|^2. Conjugation permutes the primitive odd characters and preserves \lvert S_\chi\rvert. Since \varphi(b^2)=b(b-1), the stated identity follows. ◻
Corollary 33 (L(1)-weighted window moment). For odd primes b, \sum_{\substack{\chi\bmod b^2\ \mathrm{primitive}\\\chi(-1)=-1}} |L(1,\chi)|^2|S_\chi|^2 =\frac{\pi^2}{4}(b-1)b^2+O\bigl(b^2(\log b)^2\bigr).
Proof. Proposition 32 gives \sum_{\substack{\chi\bmod b^2\ \mathrm{primitive}\\\chi(-1)=-1}} |L(1,\chi)|^2|S_\chi|^2 =\frac{\pi^2(b-1)}{4b}\,E_b . Insert Theorem 29. ◻
Proposition 34 (Spectral pole split). Expanding |S_\chi|^{2}=\sum_{v,w=1}^{b-1}\chi(v)\overline\chi(w) splits the spectral energy into a window diagonal v=w and a window off-diagonal v\ne w. The diagonal contributes \tfrac13 b^{3}+O(b^{2}), while the off-diagonal contributes \tfrac23 b^{3}+O(b^{2}(\log b)^{2}).
Proof. The diagonal part is \frac{4(b-1)}{\varphi(b^{2})} \sum_{\substack{\chi\bmod b^2\ {\rm primitive}\\ \chi(-1)=-1}} \bigl|B_{1,\chi}^{(b^2)}\bigr|^2 . The sawtooth expansion and character orthogonality identify the corresponding all-odd expression with 4(b-1)\widetilde s(1,b^2), where \widetilde s is the unit part of the Dedekind sum. The nonunit indices are a=jb, so \widetilde s(1,b^2)=s(1,b^2)-s(1,b). Since s(1,b)=O(b), restoring these indices changes the diagonal by O(b^2).
It remains to remove the odd characters induced from modulus b. If \chi is induced from \psi\bmod b, then \begin{aligned} B_{1,\chi}^{(b^2)} &=\frac1{b^2}\sum_{r=1}^{b-1}\sum_{t=0}^{b-1}(r+bt)\psi(r)\\ &=\frac1b\sum_{r=1}^{b-1}r\psi(r) +\frac{b-1}{2}\sum_{r=1}^{b-1}\psi(r)\\ &=B_{1,\psi}^{(b)}. \end{aligned} The second sum vanishes because the odd character \psi is nonprincipal. There are O(b) such characters and \lvert B_{1,\psi}^{(b)}\rvert=O(b). Their total contribution is therefore \frac{4(b-1)}{\varphi(b^2)}\,O(b^3)=O(b^2). Finally, 4(b-1)s(1,b^{2}) =\frac{(b-1)(b^{2}-1)(b^{2}-2)}{3b^{2}} =\frac13 b^{3}+O(b^{2}). Thus the primitive spectral diagonal is \tfrac13b^3+O(b^2). Subtracting it from Theorem 29 gives the off-diagonal term. ◻
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 E_b =4\sum_{\substack{v\bmod b^{2}\\(v,b)=1}}w_b(v)\,s(v,b^{2}) =b^{3}+O\!\left(b^{2}(\log b)^{2}\right). 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.
[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 Theory 7 (1975), 413–445.
[3]S. Bettin and J. B. Conrey, Period functions and cotangent sums, Algebra Number Theory 7 (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 Theory 10 (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 Theory 56 (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.
[8]K. Girstmair, The digits of 1/p in connection with class number factors, Acta Arith. 67 (1994), no. 4, 381–386. https://doi.org/10.4064/aa-67-4-381-386
[9]K. Girstmair, Digit variance and Dedekind sums, J. Number Theory 65 (1997), no. 2, 197–205. https://doi.org/10.1006/jnth.1997.2149
[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 Theory 16 (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.
[13]S. C. Kak and A. Chatterjee, On decimal sequences, IEEE Trans. Inform. Theory 27 (1981), no. 5, 647–652. https://doi.org/10.1109/TIT.1981.1056394
[14]A. Lempel and H. Greenberger, Families of sequences with optimal Hamming-correlation properties, IEEE Trans. Inform. Theory 20 (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.
[17]M. R. Murty and R. Thangadurai, The class number of \mathbb Q(\sqrt{-p}) and digits of 1/p, Proc. Amer. Math. Soc. 139 (2011), no. 4, 1277–1289. https://doi.org/10.1090/S0002-9939-2010-10560-9
[18]H. Rademacher, Generalization of the reciprocity formula for Dedekind sums, Duke Math. J. 21 (1954), 391–397. doi:10.1215/S0012-7094-54-02140-7.
[19]H. Rademacher and E. Grosswald, Dedekind Sums, Carus Mathematical Monographs 16, Mathematical Association of America, Washington, DC, 1972.
[20]L. C. Washington, Introduction to Cyclotomic Fields, 2nd ed., Graduate Texts in Mathematics 83, Springer, New York, 1997.
Discussion
Sign in to join the discussion.