Carry Boundaries and Bernoulli Spectra

The collision invariant turned out to be a special case. This paper finds the source underneath it. The floor provides the weight. The boundary provides the geometry. The spectrum is their product.

Carry Boundaries and Bernoulli Spectra
The floor provides the weight. The boundary provides the geometry. The spectrum is their product.

The collision program started with a question about digit-matching. Pick a prime, divide in some base, watch the digits. When two digits in the expansion agree, count it. The count turned out to be rigid. It decomposed over characters. It reached $L$-values. It obeyed a reflection law that locked complementary classes into exact pairs.

Here is what that looks like concretely. Divide 1 by 7 in base 10. You get the repeating decimal 142857. The first digit is 1. The fifth digit is 5. They do not match. Now divide 2 by 7. You get 285714. First digit 2, fifth digit 1. Still no match. Try 3. First digit 4, fifth digit 7. No.

But keep going through all six remainders and count every agreement between the first and fifth digits. The total is a small integer. Do the same for a different prime, say 41, or 10007. The total is always a small integer. And it depends only on the prime's last two digits, not on the prime itself.

That counting game produced twenty-four blog posts, three papers, a periodic table, and a transform that reaches the Riemann zeta function. All from counting digit agreements.

This paper steps back and asks a different question. Where did all of that actually come from? The answer is not the digit-matching. The answer is underneath it.

The answer is the carry.

The sawtooth in the floor

There is a waveform hidden inside long division. You do not see it in the digits. You see it in the fractional parts.

When you compute $br/q$ and take the floor, you get the digit. The fractional part is what you throw away. But the fractional parts are not random. As $r$ increases by 1, the fractional part ${br/q}$ rises by $b/q$, rises again, rises again, until it passes 1 and resets. The digit ticks up. The fractional part falls back to almost zero. Then it starts rising again.

That waveform, the rise-and-reset, is a sawtooth. Euler knew it. Dedekind studied it. Rademacher built a whole theory of modular forms around its reciprocity. But none of them were looking at it from inside the digit function.

The sawtooth has one property that controls everything that follows. It is an odd function. Negate the input and you negate the output. That sounds small. It is not. Oddness means that when you take the Dirichlet character transform of the sawtooth, every even character contributes zero. Only odd characters survive. And the surviving value, for a primitive odd character, is a generalized Bernoulli number $B_{1, \bar\chi}$. No auxiliary Gauss sum. No correction factor. The floor produces the Bernoulli number directly.

I call this the floor potential, because the floor is the source and the Bernoulli number is the value. Saying "Bernoulli number" names the symptom. Saying "floor potential" names the cause.

The important thing is that the floor potential does not depend on which digit pattern you are watching. It is the same whether you are counting collisions, transitions, triple agreements, or block patterns. Every carry-counting observable inherits the same universal weight from the floor.

The boundary

Now for the part that does change.

Pick a digit pattern. First digit equals last digit. Or three digits agree. Or two consecutive digits differ by exactly one. Each rule selects a set of digit-cell positions $G$ inside the finite digit space ${0, \ldots, m-1}$. You count the occurrences, center the count, and ask for the spectrum.

Here is the theorem. The spectrum always factors.

$$\widehat{F}_G(\chi) = -B_{1,\bar\chi} \cdot S_G(\chi)$$

The first factor is the floor potential. Universal. The second factor depends on $G$, but not in the way you might expect. It is not a sum over the interior of $G$. The interior cancels. Term by term, the character differences $\chi(n+1) - \chi(n)$ telescope. Consecutive values cancel against each other, the way a sum of consecutive differences always collapses to its endpoints.

All that survives is the boundary. The signed edge of $G$, the positions where you step into or out of the selected set. The boundary flux $S_G(\chi)$ is a character sum over those edge points and nothing else.

So the digit pattern contributes a boundary. The floor contributes a weight. The spectrum is their product. Change the pattern and you change the boundary. The weight never moves. This is why the collision invariant had the structure it did. Not because collisions are magical. Because collisions select a boundary, and the floor treats every boundary the same way.

Think of it as a finite version of Stokes' theorem. The integral over the region reduces to an integral over its boundary. The interior contributes nothing to the spectrum. Only the edges speak.

One theorem, many corollaries

The collision diagonal asks whether the first digit equals the last digit. That is one rule about digits. But there are others. Does the first digit equal the middle digit AND the last digit? Is the second digit exactly one more than the first? Does a specific four-digit pattern appear?

Each of these rules selects a different set of positions in the digit stream. Each set has a different boundary. And each boundary, fed through the factorization theorem, produces a different spectrum.

For two years the collision diagonal looked special. It had its own transform, its own periodic table, its own $L$-value encoding. This paper proves it is one entry in a long list. Every observable that depends on a fixed window of digits reduces to a carry-boundary observable. One reduction theorem. Two-point collisions, three-point agreements, adjacent transitions, arbitrary block patterns all fall out as corollaries with different boundaries but the same Bernoulli weight.

The paper keeps a ledger. Most rows say "reduces." A few rows say "open." The open ones are observables that depend on the full orbit, the recurrence structure, or the entire repetend. Those reach beyond any fixed window of digits. They remain outside the proved theory. They define the edge of the map.

Characters have a blind spot

The factorization raises a natural question. If the boundary flux $S_G(\chi)$ encodes the geometry of $G$, does it encode all of it?

No. And the paper says exactly what is missing.

The characters modulo $m$ can see the signed boundary chain, but only the part that lives on the unit group. Boundary points that sit at residues sharing a factor with $m$ are invisible. The character evaluates to zero there. It does not distinguish them from empty space.

Two different sets $G$ and $G'$, with completely different interiors but the same boundary restricted to units, produce exactly the same spectrum. The characters cannot tell them apart.

This is not an approximation or a bound. It is a theorem about the image and kernel of the character pairing. The characters see a specific projection of the boundary, and the paper identifies that projection precisely.

The square-root law

In analytic number theory, square-root cancellation is the central phenomenon. Character sums of length $N$ are expected to have size $\sqrt{N}$, not $N$. When they do, you get prime number theorems and zero-free regions and everything that flows from them. When they do not, you get stuck.

For collision diagonals at odd prime-power moduli, this paper proves square-root cancellation as an identity, not an estimate.

$$\frac{1}{n_{\mathrm{po}}} \sum_{\chi \text{ primitive odd}} |S_G(\chi)|^2 = 2\,|\partial G|$$

The average of $|S_G(\chi)|^2$ over primitive odd characters is exactly twice the boundary size. The word "exactly" is doing real work. There is no error term. The diagonal terms, each boundary point interacting with itself, contribute exactly as much as the off-diagonal terms, boundary points interacting with each other. Perfect balance between self and cross.

That balance is the structural reason the cancellation holds. It is not an accident of averaging. It is a consequence of the conductor arithmetic at prime powers, where the boundary has the right symmetries to make the orthogonality collapse cleanly.

At composite bases, the symmetry breaks. The paper works out base 15, where lower-conductor characters leak into the average and the identity fails. The failure is controlled and explicit. It tests the conductor bookkeeping, which holds up, even where the mean law does not.

The source

For most of this program I thought the collision invariant was the fundamental object. The signed table, the reflection pairs, the character decomposition. Those were the things I was studying. They were real. They are still real.

But they are not the source.

The source is the carry. The threshold crossing in the floor. The sawtooth it leaves behind. The Bernoulli number that the sawtooth produces under the character transform. Every observable in the collision program, every one, inherits its spectral shape from that single mechanism.

The collision diagonal does not know it is special. The floor does not know it is counting collisions. The Bernoulli number weighs every carry the same way, regardless of which digit rule selected it. The $L$-function shadow in the energy is not a property of digit-matching. It is a property of the sawtooth, passed to every observable that counts threshold crossings.

The earlier papers found structure in the collision table. This paper found what put it there.


Try it yourself

The collision periodic table is the object where the boundary calculus lands. Each entry is a carry count, centered and reduced. The antisymmetry $S(a) + S(b^2 - a) = -1$ is the reflection identity that pairs every entry with its complement.

Print the table at base 3. Six entries on the coprime classes mod 9 (the dots mark classes divisible by 3, which are excluded). The three complement pairs, $(1,8)$, $(2,7)$, $(4,5)$, each sum to $-1$.

$ ./nfield table --base 3

Now base 10. Forty entries on the coprime classes mod 100. Twenty complement pairs, each summing to $-1$. The largest entry is $+8$ at class 09. The smallest is $-9$ at class 91.

$ ./nfield table --base 10

Check the reflection identity. Every complement pair $S(a) + S(b^2 - a)$ should equal $-1$, with no exceptions.

$ ./nfield verify antisymmetry

Check the parity rule. Even Dirichlet characters should contribute exactly zero to the collision spectrum. This is the sawtooth's oddness at work.

$ ./nfield verify even-killed

Check the Parseval moment identity. The table-side energy should equal the spectral-side $L$-value moment, term by term.

$ ./nfield verify decomposition

Code: github.com/alexspetty/nfield


Alexander S. Petty
May 2026
.:.