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

The Collision Invariant

March 29, 202611 min read
Companion paper: The Collision Invariant →
Blue and gold paths connect a field of rectangular bins to two rows of glowing points.
The collision count grows with the denominator. Its deviation repeats in a finite table.

Divide 4 by 13. Then divide 5 by 13.

413=0.307692‾,513=0.384615‾.\begin{aligned} \frac4{13}&=0.\overline{307692},\\ \frac5{13}&=0.\overline{384615}. \end{aligned}134​135​​=0.307692,=0.384615.​

Both begin with a 3. Long division produces that digit from two different remainders, 4 and 5. They occupy the same digit bin.

Now multiply the remainder 5 by 6.

6×5=30=2×13+4.6\times5=30=2\times13+4.6×5=30=2×13+4.

After division by 13, the remainder is 4. Multiplication has moved us from one remainder to another, but the next digit is still 3. I call this a collision.

Do the same thing to every nonzero remainder. Multiplication by 6 gives two collisions. Multiplication by 11 also gives two. Every other multiplier except 1 gives none.

Multiplier 2 3 4 5 6 7 8 9 10 11 12
Collisions 0 0 0 0 2 0 0 0 0 2 0

Nine zeros. At 29 there are nine too. At every prime larger than ten, exactly nine multipliers move every remainder out of its digit bin. The other collision counts change with the prime. This count does not.

The question that interests me is how a rule this simple can keep giving the same answer while the number of remainders grows. Four finite results fit together around that question. They describe the multipliers that give no matches, the part of the count that repeats, and the symmetry inside it.

Keeping the groups, changing the labels

The digit function writes the long-division step in one expression,

δ(r)=⌊brp⌋.\delta(r)=\left\lfloor\frac{br}{p}\right\rfloor.δ(r)=⌊pbr​⌋.

Here bbb is the base and ppp the denominator. The floor means round down. In base ten with denominator 13, the remainders 4 and 5 both give 3 because 40/1340/1340/13 and 50/1350/1350/13 both lie between 3 and 4.

Multiply each remainder by ten and keep its remainder modulo 13. Our pair becomes

4⟼1,5⟼11.4\longmapsto1,\qquad 5\longmapsto11.4⟼1,5⟼11.

The two new labels have the same final digit. This happens throughout the partition. Each digit bin becomes a group of numbers with the same remainder upon division by ten.

The remainders in each row still belong together after multiplication by ten. Matching digits become matching final digits in the new labels.
The remainders in each row still belong together after multiplication by ten. Matching digits become matching final digits in the new labels.

The bin numbered 3 has become the class ending in 1. The groups are preserved, though their names change. This distinction is useful. We can forget the interval boundaries and compare remainders modulo the base instead.

I call this the linearization. It works because long division gives the exact identity br=pδ(r)+xbr=p\delta(r)+xbr=pδ(r)+x, where xxx is the new remainder. Modulo bbb, this says x≡−pδ(r)x\equiv-p\delta(r)x≡−pδ(r). Since ppp and bbb have no common factor, different digits produce different classes.

The collision count is now a congruence count. Multiply a new label xxx by ggg, reduce modulo ppp, and ask whether its remainder modulo bbb changed.

The nine multipliers

The linearization gives the entire zero set,

g≡−ub−u(modp).g\equiv-\frac{u}{b-u}\pmod p.g≡−b−uu​(modp).

Take u=1,…,b−1u=1,\ldots,b-1u=1,…,b−1.

Division here means modular division. To divide by b−ub-ub−u, multiply by the number that makes b−ub-ub−u equal to 1 modulo ppp. That number exists because p>bp>bp>b.

For base ten and p=13p=13p=13, choosing u=1u=1u=1 gives −1/9≡10-1/9\equiv10−1/9≡10. Indeed, 9×10≡−19\times10\equiv-19×10≡−1 modulo 13. Choosing u=5u=5u=5 gives −5/5=−1≡12-5/5=-1\equiv12−5/5=−1≡12. Both multipliers appear among the zeros in the opening table.

There are nine distinct answers as uuu runs from 1 to 9. At another prime, the same nine fractions give a different list of multipliers. The proof shows that this list is complete.

This is the gate width theorem. In every base b≥2b\geq2b≥2, every prime p>bp>bp>b has exactly b−1b-1b−1 such multipliers. The base need not generate every nonzero remainder. Short repeating cycles and long ones are all included.

The complement multiplier −1-1−1 has a familiar explanation in an even base. It replaces each digit ddd by b−1−db-1-db−1−d. No digit equals its own complement, so no digit survives. In the rational family it is the middle choice u=b/2u=b/2u=b/2.

Ten more collisions

Fix the multiplier at the base itself. In decimal notation, multiplication by ten advances the long division by one position. We count the remainders whose next two digits agree.

For denominator 109, there are 18. Subtract ⌊108/10⌋=10\lfloor108/10\rfloor=10⌊108/10⌋=10, the smaller digit-bin size, and the difference is 8.

For denominator 409, there are 48. Subtract 40. Again 8.

Denominator NNN Collisions CN(10)C_N(10)CN​(10) Baseline ⌊(N−1)/10⌋\lfloor(N-1)/10\rfloor⌊(N−1)/10⌋ Difference
109 18 10 8
209 28 20 8
409 48 40 8
1009 108 100 8

I have included 209 deliberately. It is 11×1911\times1911×19, and it follows the same rule. The count uses all the nonzero remainders, including those that have a factor in common with the denominator.

The signed difference is the collision invariant,

S(N)=CN(b)−⌊N−1b⌋.S(N)=C_N(b)-\left\lfloor\frac{N-1}{b}\right\rfloor.S(N)=CN​(b)−⌊bN−1​⌋.

The baseline records the scale of a digit bin. It is not the exact average over multipliers.

To see why the difference repeats, divide the interval from 0 to 1 into a hundred equal pieces. Label them 00 through 99. A fraction in piece 37 begins with the digits 37. Its first two digits agree precisely when it falls in one of the ten pieces 00, 11, 22, and so on through 99.

Going from denominator 109 to 209 adds one remainder to each of the hundred pieces. Ten pieces have equal digits, so the collision count gains ten. The baseline gains ten too.
Going from denominator 109 to 209 adds one remainder to each of the hundred pieces. Ten pieces have equal digits, so the collision count gains ten. The baseline gains ten too.

When a denominator coprime to ten increases by 100, each piece gains one remainder. Each of the ten selected pieces contributes one more collision. The subtraction removes exactly those ten additions. Only the last two digits of the denominator are left in the answer.

This is finite determination. For N>100N>100N>100 coprime to ten, S(N)S(N)S(N) depends only on N mod 100N\bmod100Nmod100. The forty eligible endings make the collision periodic table.

Two digits are necessary. Endings 01 and 91 have the same last digit, but their invariant values are 0 and −9-9−9. No rule that reads just that final digit can distinguish them.

At lag ℓ\ellℓ, we compare digits ℓ\ellℓ positions apart. The determining modulus is bℓ+1b^{\ell+1}bℓ+1, so the final ℓ+1\ell+1ℓ+1 base-bbb digits suffice when N>bℓ+1N>b^{\ell+1}N>bℓ+1 and NNN is coprime to bbb. The proof supplies a pair of classes at every base and lag that agree in their last ℓ\ellℓ digits but give different values. The last digit we add is doing necessary work.

The partner of 09

The class ending in 09 gives +8+8+8. Its partner, 91, gives −9-9−9. They add to −1-1−1.

The same relation holds throughout the table,

Ending aaa S(a)S(a)S(a) Ending 100−a100-a100−a S(100−a)S(100-a)S(100−a) Sum
01 0 99 −1-1−1 −1-1−1
03 2 97 −3-3−3 −1-1−1
09 8 91 −9-9−9 −1-1−1
17 1 83 −2-2−2 −1-1−1

There are twenty pairs. Each contributes −1-1−1, so the forty entries total −20-20−20. Their average is exactly −1/2-1/2−1/2.

The reflection identity holds in every base and at every lag. With m=bℓ+1m=b^{\ell+1}m=bℓ+1, it reads

Sℓ(a)+Sℓ(m−a)=−1.S_\ell(a)+S_\ell(m-a)=-1.Sℓ​(a)+Sℓ​(m−a)=−1.

The average here is over the finite table. There is no question about how often primes visit its classes in this calculation. Pairing the entries is enough.

A crossing and its reflection

Inside the table formula are small yes-or-no counts. At the decimal piece 11, for instance, we ask whether the step from 11a11a11a to 12a12a12a crosses a multiple of 100.

For a=9a=9a=9, the step goes from 99 to 108. It crosses 100. For the partner a=91a=91a=91, it goes from 1001 to 1092. It stays below 1100.

The step for 09 crosses a hundred boundary. Its reflected partner 91 stays within the same hundred. Every eligible pair splits this way.
The step for 09 crosses a hundred boundary. Its reflected partner 91 stays within the same hundred. Every eligible pair splits this way.

Among the forty eligible endings, exactly twenty cross and twenty do not. Replace piece 11 by any interior piece from 01 to 98 and the split is still twenty and twenty. The members of each group can change. Its size cannot.

This is the half-group law. It holds among the residue classes coprime to any modulus m≥3m\geq3m≥3, with no requirement that mmm be a power of a base. Reflection pairs a crossing with a noncrossing. The first and last pieces are excluded because their steps never cross and always cross, respectively. Keeping those two endpoints in the full collision count gives the offset −1-1−1 in the reflection identity.

I like that the balance can be inspected at both scales. The table pairs whole invariant values. The half-group law pairs the individual crossings from which those values are built. The same reflection is visible in each.

We began with two fractions whose first digit was 3. Following that agreement through multiplication gives a zero set, a finite table and an exact balance within the table. A denominator can grow without bound while its collision deviation stays fixed. The reason is in the count itself. Every complete block adds the same amount to the collisions and to the baseline. What distinguishes one ending from another is the part of the count that the complete blocks cannot change.

Companion paper: The Collision Invariant →
Share

Discussion

Sign in to join the discussion.

← All articlesRead the paper →
← Previous: The Analytic Collision Transform
Next: The Collision Transform →