Petty's Notebook
ArticlesPapersnfieldAbout
Get notified when new posts are published. No spam, just math.
Alexander S. Petty  |  ©2009-2026
← Back
Boundaries

Carry Boundaries and Bernoulli Spectra

May 29, 202612 min read
Companion paper: Carry Boundaries and Bernoulli Spectra in Long Division →
Gold joins mark where the digit rule switches on and off along the blue contour, and the rule's arithmetic lives at those joins. The floor function gives every rule the same sawtooth response, so changing the rule changes only the boundary factor.
Gold joins mark where the digit rule switches on and off along the blue contour, and the rule's arithmetic lives at those joins. The floor function gives every rule the same sawtooth response, so changing the rule changes only the boundary factor.

Pick any question about the first two digits of a fraction, whether they are equal, whether the second is larger, whether they spell one particular pair. Each looks like its own small counting problem with its own count to do. Over all the fractions with a given denominator, though, every one of them reduces to a small table of carries, and the spectrum of that table splits the same way each time. One factor comes from the floor function and is identical for every question. The other is a short list of places where the question switches from no to yes and back, and that list is all a question gets to choose.

The shared factor is a generalized Bernoulli number, the one inside the collision coefficients of The Collision Spectrum, and the floor’s response is classical. The new part is the reduction itself, from any finite digit rule to its edges, and an accounting of those edges by conductor. For words whose first and last digits agree in an odd prime base, the edges have a clean average, twice their number. Base fifteen breaks it, giving 282828 where the clean rule predicts 606060, and the accounting finds the difference at two lower resolutions.

Four matches at eleven

Base three keeps the example small. Divide each of 111 through 101010 by eleven, in base three, and read the first two digits after the point. At numerators 111, 555, 666 and 101010 they are 000000, 111111, 111111 and 222222, four matches. The same count comes from a different picture. Split the unit interval into nine equal cells, one for each possible beginning 00,01,02,10,11,12,20,21,2200,01,02,10,11,12,20,21,2200,01,02,10,11,12,20,21,22 in that order, and color the three cells with matching digits gold. A fraction passes the test exactly when it lands on gold. Any rule about the first two digits is a choice of cells, and the counting that follows works the same way for all of them.

Ten fraction dots lie across nine equal base-three digit cells. Gold cells 00, 11 and 22 contain four dots. Below them, a walk in increments of two ninths crosses an integer in each of the last two gold cells. Ten fraction dots lie across nine equal base-three digit cells. Gold cells 00, 11 and 22 contain four dots. Below them, a walk in increments of two ninths crosses an integer in each of the last two gold cells.
The ten fractions of eleven on nine cells, gold where the first two base-three digits agree. Below, the leftover 2/9 piling up, with its two carries in gold cells.

In the top row the ten fractions sit at their exact positions, and the gold cells 000000, 111111 and 222222 catch numerators 111, 555, 666 and 101010. The cells are 1/91/91/9 wide and the fractions 1/111/111/11 apart, so some cells hold an extra fraction, and the extras can be counted without listing anything. Write 11/911/911/9 as one plus 2/92/92/9. Each cell gets one whole fraction, and the leftover 2/92/92/9 piles up from cell to cell. In the lower panel that running total is the teal line and its integer part is the staircase. The staircase rises twice, in cell 111111 at step five and in cell 222222 at step nine, and each rise is a carry that puts one more fraction in a cell. Both carries land in gold cells. Three gold cells give three whole fractions and the two carries give two more. The floor count also includes 11/1111/1111/11 at the far end, though, while the fractions stop at 10/1110/1110/11. Removing it leaves

3+2−1=4.3+2-1=4.3+2−1=4.

Replace eleven by twenty. Each cell now gets two whole fractions, but the leftover is still 2/92/92/9, so the carry walk is the same and the count is 6+2−1=76+2-1=76+2−1=7. Every denominator that leaves remainder two on division by nine reuses this little walk.

The floor count for any fixed digit rule

For a prefix of length NNN in base bbb, put m=bNm=b^Nm=bN. A weight w(n)w(n)w(n) records the rule on cell nnn. It can be zero or one, or a more general numerical weight. Assume the denominator qqq is coprime to the base and write q=hm+aq=hm+aq=hm+a, with 1≤a<m1\le a<m1≤a<m.

The exact identity is

Cw(q)=h∑n=0m−1w(n)+Aw(a)−w(m−1),\begin{aligned} C_w(q)&=h\sum_{n=0}^{m-1}w(n)\\ &\quad+A_w(a)-w(m-1), \end{aligned}Cw​(q)​=hn=0∑m−1​w(n)+Aw​(a)−w(m−1),​

where

Aw(a)=∑n=0m−1w(n)κn(a),A_w(a)=\sum_{n=0}^{m-1}w(n)\kappa_n(a),Aw​(a)=n=0∑m−1​w(n)κn​(a),

κn(a)=⌊(n+1)am⌋−⌊nam⌋.\kappa_n(a)=\left\lfloor\frac{(n+1)a}{m}\right\rfloor-\left\lfloor\frac{na}{m}\right\rfloor.κn​(a)=⌊m(n+1)a​⌋−⌊mna​⌋.

Each floor difference counts integers in the corresponding right-closed interval. Coprimality prevents a fraction from landing on an interior cell boundary. The last interval includes q/qq/qq/q, which accounts for the subtraction. It is an endpoint correction.

At q=11q=11q=11, the selected cells are G={0,4,8}G=\{0,4,8\}G={0,4,8}, and AG(2)=2A_G(2)=2AG​(2)=2. At q=20q=20q=20, the same AG(2)A_G(2)AG​(2) appears. The growing denominator changes the bulk count while the carry calculation stays finite.

Rub out the interior lines

Now put two selected cells side by side. Each has an entrance and an exit, and at the shared edge an exit meets an entrance. Give them opposite signs and they cancel. A run of a thousand selected cells loses all its inside edges the same way and keeps only its entrance and its exit. The floor differences telescope in exactly this pattern.

A run of three selected cells loses its two interior exit-entrance pairs. Below, the nine digit cells form a ring. At its seam zero meets nine, leaving four signed endpoints at one, four, five and eight. A run of three selected cells loses its two interior exit-entrance pairs. Below, the nine digit cells form a ring. At its seam zero meets nine, leaving four signed endpoints at one, four, five and eight.
Selected cells side by side lose their inner edges. Closed into a ring, the nine cells keep four signed marks, at 1, 4, 5 and 8.

The upper drawing shows three selected cells in a row, with both inner edges cancelled and only the entrance at −1-1−1 and the exit at +1+1+1 left. The ring below closes the nine cells into a circle, so the exit after 222222 lands on the entrance at 000000 and those two cancel as well. Four signed marks survive, +1+1+1 after 000000, −1-1−1 before 111111, +1+1+1 after 111111 and −1-1−1 before 222222. That boundary is all the rule leaves behind. Once the bulk count and the endpoint correction are removed, those four switches determine the whole carry table, and a long list of selected cells shrinks to a short list of changes.

The signed boundary and the sawtooth

With indices read cyclically, define

μw(x)=w(x−1)−w(x).\mu_w(x)=w(x-1)-w(x).μw​(x)=w(x−1)−w(x).

An entrance has sign −1-1−1 and an exit +1+1+1. For G={0,4,8}G=\{0,4,8\}G={0,4,8} the nonzero values are μ(1)=μ(5)=1\mu(1)=\mu(5)=1μ(1)=μ(5)=1 and μ(4)=μ(8)=−1\mu(4)=\mu(8)=-1μ(4)=μ(8)=−1.

The centered sawtooth is

sm(n)=nm−12(1≤n<m),sm(0)=0,\begin{aligned} s_m(n)&=\frac{n}{m}-\frac12\quad(1\le n<m),\\ s_m(0)&=0, \end{aligned}sm​(n)sm​(0)​=mn​−21​(1≤n<m),=0,​

extended periodically. Summing by parts gives the centered carry function

Fw(a)=−∑x mod mμw(x)sm(xa).F_w(a)=-\sum_{x\bmod m}\mu_w(x)s_m(xa).Fw​(a)=−xmodm∑​μw​(x)sm​(xa).

For unit residues aaa, meaning gcd⁡(a,m)=1\gcd(a,m)=1gcd(a,m)=1, its relation to the floor count is

Fw(a)=Aw(a)−am∑nw(n)+w(0)−w(m−1)2.\begin{aligned} F_w(a)&=A_w(a)-\frac{a}{m}\sum_nw(n)\\ &\quad+\frac{w(0)-w(m-1)}2. \end{aligned}Fw​(a)​=Aw​(a)−ma​n∑​w(n)+2w(0)−w(m−1)​.​

The last correction is zero for our example, because both end cells are selected. The complete six-entry table follows, with no interpolation between entries.

Residue Carry count Centered value
1 1 2/3
2 2 4/3
4 2 2/3
5 1 -2/3
7 1 -4/3
8 2 -2/3

The sawtooth reverses sign under reflection, so Fw(−a)=−Fw(a)F_w(-a)=-F_w(a)Fw​(−a)=−Fw​(a). This is why its comparisons with even characters vanish.

Four arrows take the long way home

To read a spectrum, compare the carry table with arithmetic waves. A wave gives each allowed remainder an arrow, and multiplying remainders adds their angles. That is a Dirichlet character, drawn instead of written. The comparison can use every entry of the carry table, or it can start from the four signed endpoints alone.

Four signed endpoint arrows form a path to three minus square root of three times i. A clockwise turn and stretch send its displacement to the gold star at two minus twice square root of three times i. A six-step carry-table path below reaches the same star. Four signed endpoint arrows form a path to three minus square root of three times i. A clockwise turn and stretch send its displacement to the gold star at two minus twice square root of three times i. A six-step carry-table path below reaches the same star.
The four boundary arrows reach 3 − i√3. Turned 30° and stretched by 2/√3, they land on the same star the six carry values reach.

The upper drawing takes the second route, for the wave that turns sixty degrees at each doubling. Each endpoint contributes its arrow, reversed at an entrance, and the four arrows laid head to tail reach the open circle marked boundary response, at 3−i33-i\sqrt33−i3​. Turning that point thirty degrees clockwise and stretching it by 2/32/\sqrt32/3​ lands on the gold star. The lower drawing ignores the boundary and adds all six weighted carry values directly, and it arrives at the same star, 2−2i32-2i\sqrt32−2i3​.

The fixed turn and stretch come from the floor. Written as a complex number they are the negative of a generalized Bernoulli number, which enters because the fractional part climbs steadily between integers and drops back at each one, a sawtooth. For a primitive odd character, one that reverses under reflection and needs the full grid, that factor is the same whatever cells are colored. Change the gold cells and the boundary arrows change, while the floor keeps supplying the same turn and stretch.

The factorization and both routes to the gold star

A primitive character belongs to the full modulus rather than being inherited from a smaller one. An odd character satisfies χ(−1)=−1\chi(-1)=-1χ(−1)=−1. For such a character, define the ordinary boundary flux and the unnormalized carry transform by

Sw(χ)=∑xμw(x)χ(x),S_w(\chi)=\sum_x\mu_w(x)\chi(x),Sw​(χ)=x∑​μw​(x)χ(x),

F^w(χ)=∑a∈(Z/mZ)×Fw(a)χ(a)‾.\widehat F_w(\chi)=\sum_{a\in(\mathbb Z/m\mathbb Z)^\times}F_w(a)\overline{\chi(a)}.Fw​(χ)=a∈(Z/mZ)×∑​Fw​(a)χ(a)​.

Then the exact factorization is

F^w(χ)=−B1,χˉ Sw(χ),\widehat F_w(\chi)=-B_{1,\bar\chi}\,S_w(\chi),Fw​(χ)=−B1,χˉ​​Sw​(χ),

where

B1,χˉ=1m∑a=1maχ(a)‾.B_{1,\bar\chi}=\frac1m\sum_{a=1}^{m}a\overline{\chi(a)}.B1,χˉ​​=m1​a=1∑m​aχ(a)​.

For a unit endpoint xxx, substituting u=xau=xau=xa in the sawtooth transform gives χ(x)B1,χˉ\chi(x)B_{1,\bar\chi}χ(x)B1,χˉ​​. For a nonunit endpoint, the primitive character sum vanishes. Applying this to the boundary sum proves the formula. Even coefficients vanish by reflection.

In the drawing, m=9m=9m=9 and χ(2)=eπi/3\chi(2)=e^{\pi i/3}χ(2)=eπi/3. Multiplication by two visits 1,2,4,8,7,51,2,4,8,7,51,2,4,8,7,5 and then returns to one. The arrow turns sixty degrees at each step.

The four boundary arrows sum to

SG(χ)=1−χ(4)+χ(5)−χ(8)=3−i3.\begin{aligned} S_G(\chi)&=1-\chi(4)+\chi(5)-\chi(8)\\ &=3-i\sqrt3. \end{aligned}SG​(χ)​=1−χ(4)+χ(5)−χ(8)=3−i3​.​

The floor factor is

−B1,χˉ=1−i3.-B_{1,\bar\chi}=1-\frac{i}{\sqrt3}.−B1,χˉ​​=1−3​i​.

Its angle is minus thirty degrees and its length is 2/32/\sqrt32/3​. Multiplying gives

F^G(χ)=2−2i3.\widehat F_G(\chi)=2-2i\sqrt3.FG​(χ)=2−2i3​.

The lower path adds FG(a)χ(a)‾F_G(a)\overline{\chi(a)}FG​(a)χ(a)​ in the numerical order a=1,2,4,5,7,8a=1,2,4,5,7,8a=1,2,4,5,7,8. It produces the same complex number. The conjugate character supplies the reflected coefficient. These are the only two nonzero coefficients of this table.

A finer grid can say nothing new

Split each of the nine cells into three, making twenty-seven, enough to read three digits, and keep all three children of each gold cell selected. The drawing is finer, but the test still asks only about the first two digits.

Nested rings with nine, twenty-seven and eighty-one cells select identical gold arcs. The four signed borders line up radially. Below, equal gold circles show total normalized power eight ninths at conductor nine for each grid; available higher conductors have zero power. Nested rings with nine, twenty-seven and eighty-one cells select identical gold arcs. The four signed borders line up radially. Below, equal gold circles show total normalized power eight ninths at conductor nine for each grid; available higher conductors have zero power.
The gold arcs at nine, twenty-seven and eighty-one cells, with the same four border rays. Below, all the power sits at conductor nine.

The rings in the figure go from nine cells to twenty-seven to eighty-one, and the gold arcs never move. Every new interior edge cancels, so the four border rays stay exactly where they were. The table below sorts the spectrum by conductor, the least modulus a character actually needs. Every grid puts its whole power, 8/98/98/9, at conductor nine, and the columns for twenty-seven and eighty-one stay empty. A finer grid that asks the same question adds no new response.

Refinement, and the limits of ordinary flux

At modulus twenty-seven the selected cells are

G27={0,1,2,12,13,14,24,25,26}.G_{27}=\{0,1,2,12,13,14,24,25,26\}.G27​={0,1,2,12,13,14,24,25,26}.

The surviving endpoints are 3,12,15,243,12,15,243,12,15,24, with signs +,−,+,−+,-,+,-+,−,+,−. All are divisible by three, so every ordinary character flux modulo twenty-seven is zero. The primitive carry transforms are zero too, but the induced carry transforms need not be.

In fact F27(a)=F9(a mod 9)F_{27}(a)=F_9(a\bmod9)F27​(a)=F9​(amod9). Each unit class modulo nine has three lifts. Thus an inherited unnormalized coefficient is three times its old value. The average coefficient, divided by the number of unit classes, is unchanged. The figure uses those average coefficients. Each of the two active characters has power 4/94/94/9, giving 8/98/98/9 at conductor nine at every displayed resolution.

The distinction is essential. Ordinary fluxes determine exactly the boundary on units, because characters are zero on nonunits. They do not determine every induced carry transform. For a small counterexample, select cells zero and one modulo six. The two endpoints, zero and two, are nonunits. All ordinary fluxes vanish. Yet the odd character inherited from modulus three gives carry transform 1/31/31/3.

At a prime power m=pNm=p^Nm=pN, a character induced from a primitive character χ∗\chi^*χ∗ of conductor ptp^tpt uses a depth-sensitive endpoint weight. For x=pvux=p^vux=pvu with p∤up\nmid up∤u,

ηχ(x)=pvχ∗(u)if v≤N−t,\eta_\chi(x)=p^v\chi^*(u)\quad\text{if }v\le N-t,ηχ​(x)=pvχ∗(u)if v≤N−t,

and the weight is zero at greater depth, including x=0x=0x=0. The complete induced formula is

F^w(χ)=−B1,χˉ∗∑xμw(x)ηχ(x).\widehat F_w(\chi)=-B_{1,\bar\chi^*}\sum_x\mu_w(x)\eta_\chi(x).Fw​(χ)=−B1,χˉ​∗​x∑​μw​(x)ηχ​(x).

The additional weight recovers the information that ordinary flux discards.

Fifteen refuses the easy answer

The boundary also controls a clean average. In an odd prime base, select the words whose first and last digits agree, square the sizes of their primitive odd boundary responses and average them. The answer is twice the number of formal interval endpoints, counted before the cells are closed into a ring. The three gold cells in base three have six formal endpoints, and both primitive odd characters there give a squared response of exactly twelve.

Base fifteen is where that rule fails. Its fifteen matching two-digit cells have thirty formal endpoints, which predicts 606060, and the actual mean is 282828. The missing 323232 can be located. Viewed modulo 757575 and modulo 454545, the boundary still carries signed mass, and removing those inherited contributions subtracts 202020 and 121212. In an odd prime base the corresponding lower sums cancel, and the clean answer depends on that cancellation.

See the surviving boundary at the lower resolutions
Four residue rings show the base-fifteen unit boundary collected modulo 225, 75, 45 and 15. Sixteen signed marks remain in each of the first three rings; all cancel in the last. The associated signed contributions to the mean are sixty, minus twenty, minus twelve and zero. Four residue rings show the base-fifteen unit boundary collected modulo 225, 75, 45 and 15. Sixteen signed marks remain in each of the first three rings; all cancel in the last. The associated signed contributions to the mean are sixty, minus twenty, minus twelve and zero.
Base fifteen’s boundary collected modulo 225, 75, 45 and 15. The ledger terms are +60, −20, −12 and 0, giving 28.

For an odd prime base ppp and depth N≥2N\ge2N≥2, the first-equals-last rule has 2pN−12p^{N-1}2pN−1 formal endpoints. Its primitive odd mean is

1npo∑χ primitive odd∣SG(χ)∣2=4pN−1.\frac1{n_{\rm po}}\sum_{\chi\ \mathrm{primitive\ odd}}|S_G(\chi)|^2=4p^{N-1}.npo​1​χ primitive odd∑​∣SG​(χ)∣2=4pN−1.

Here npo=pN−2(p−1)2/2n_{\rm po}=p^{N-2}(p-1)^2/2npo​=pN−2(p−1)2/2. The proof uses two properties of the unit boundary. Reflection reverses its signs, and each unit residue class at the next lower resolution receives equal entrance and exit mass.

For a general modulus, restrict μ\muμ to units and collect its signed mass modulo each divisor ddd. Write that collected mass as Md(r)M_d(r)Md​(r) and set

Dd=∑r∣Md(r)∣2,Ad=∑rMd(r)Md(−r)‾.\begin{aligned} D_d&=\sum_r|M_d(r)|^2,\\ A_d&=\sum_rM_d(r)\overline{M_d(-r)}. \end{aligned}Dd​Ad​​=r∑​∣Md​(r)∣2,=r∑​Md​(r)Md​(−r)​.​

The primitive odd total is given by the conductor ledger

12∑d∣mμMob(m/d)φ(d)(Dd−Ad).\frac12\sum_{d\mid m}\mu_{\rm Mob}(m/d)\varphi(d)(D_d-A_d).21​d∣m∑​μMob​(m/d)φ(d)(Dd​−Ad​).

The symbol μMob\mu_{\rm Mob}μMob​ denotes the Möbius function, not the signed boundary. Its signs perform inclusion-exclusion over conductors.

At base fifteen, m=225m=225m=225 and G={0,16,32,…,224}G=\{0,16,32,\ldots,224\}G={0,16,32,…,224}. There are sixteen nonzero unit-boundary entries. Their collected masses vanish modulo fifteen but not modulo forty-five or seventy-five. The only nonzero Möbius weights occur at the four divisors shown.

Divisor Squared norm Reflection sum Mean term
225 16 -16 60
75 16 -16 -20
45 16 -16 -12
15 0 0 0

The total is 896896896, across 323232 primitive odd characters. Dividing gives 282828. Negative ledger terms remove overlap; the squared responses themselves are nonnegative.

Energy, Dedekind sums and the full proof

Adding the squared carry values defines an energy. Parseval gives its equivalent spectral expression,

E(Fw)=∑a∈(Z/mZ)×∣Fw(a)∣2,E(F_w)=\sum_{a\in(\mathbb Z/m\mathbb Z)^\times}|F_w(a)|^2,E(Fw​)=a∈(Z/mZ)×∑​∣Fw​(a)∣2,

E(Fw)=1φ(m)∑χ mod m∣F^w(χ)∣2.E(F_w)=\frac1{\varphi(m)}\sum_{\chi\bmod m}|\widehat F_w(\chi)|^2.E(Fw​)=φ(m)1​χmodm∑​∣Fw​(χ)∣2.

The six values in our modulus-nine table give E=16/3E=16/3E=16/3. On the spectral side, each of the two active coefficients has squared magnitude sixteen, so the same energy is 32/632/632/6.

Expanding the boundary formula gives a second description in terms of sawtooth correlations. At unit endpoint indices, these correlations are finite Möbius combinations of classical Dedekind sums. The Bernoulli factor on the character side satisfies

∣B1,χˉ∣=mπ∣L(1,χ)∣|B_{1,\bar\chi}|=\frac{\sqrt m}{\pi}|L(1,\chi)|∣B1,χˉ​​∣=πm​​∣L(1,χ)∣

for primitive odd characters. Thus the finite carry energy retains both the selected boundary and classical arithmetic factors.

These are finite identities. Growth estimates as the base or depth increases require further bounds. A rule on a whole remainder orbit also needs more than the fixed-prefix boundary constructed here.

Carry Boundaries and Bernoulli Spectra in Long Division supplies the proofs, the general weighted formulation and the conductor-depth energy decomposition. Its archived editions retain the research record. The finite-table background is developed in The Collision Invariant and The Collision Spectrum.

Three compact views of the calculation
The nine-cell count in compact form. Selected cells are zero, four and eight; numerators one, five, six and ten give four matches.
The nine-cell count in compact form, with selected cells 0, 4 and 8.
The formal endpoints and their cyclic cancellation. The seam at zero and nine removes one entrance-exit pair.
The formal endpoints and their cancellation where 0 meets 9.
The signed divisor ledger for base fifteen. Sixty minus twenty minus twelve gives the mean twenty-eight.
The base-fifteen ledger, 60 − 20 − 12 = 28.

The question set aside at the start can be answered now. Ask instead whether the second base-three digit is larger than the first. The gold cells become 010101, 020202 and 121212, with edges at 111, 333, 555 and 666. Two of those edges, 333 and 666, are multiples of three, which no primitive character can see, and the two that remain are both entrances. Their arrows sum to −3/2+i3/2-3/2+i\sqrt3/2−3/2+i3​/2, and the same thirty-degree turn and stretch by 2/32/\sqrt32/3​ carry that to −1+i3-1+i\sqrt3−1+i3​, exactly what the new carry table gives when it is added up directly.

That is minus half the collision coefficient, and for a reason. The equal, larger and smaller questions split the nine cells among themselves. Together they select everything, and a rule that selects everything has no edges and no spectrum, so their three tables add to zero. Reflection turns each fraction’s digits around and makes larger and smaller respond identically, which leaves each of them minus half of the collision table, −1/3-1/3−1/3, −2/3-2/3−2/3, −1/3-1/3−1/3, 1/31/31/3, 2/32/32/3 and 1/31/31/3 at the residues 111, 222, 444, 555, 777 and 888.

Companion paper: Carry Boundaries and Bernoulli Spectra in Long Division →
Share

Discussion

Sign in to join the discussion.

← All articlesRead the paper →
← Previous: The Structure That Survives
Next: The Orbit's Edge →