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

The Collision Invariant

March 29, 202621 min read
Companion paper: The Collision Invariant →
A long path leaves a compact pattern of repeated turns. Increasing denominators keep returning to deviations determined by the same finite residue table.
A long path leaves a compact pattern of repeated turns. Increasing denominators keep returning to deviations determined by the same finite residue table.

Line up the repeating decimal of 1/p1/p1/p with a copy of itself shifted one place, and count the digits that match. The count looks as if it should depend on everything about the prime. Instead it obeys a few exact laws that hold for every prime at once, and for most denominators that aren’t prime as well. In decimal, exactly nine multipliers move every remainder to a different digit, whatever the prime. The number of matches is fixed, up to the size of a digit bin, by the last two digits of the denominator. Those laws are the ground the rest of this work builds on, the character sums and the LLL-functions included.

Until now this series has been research notes, each one following the question the last one left open. This paper is the first place the notes are distilled. It states the laws once, with complete proofs that stand without the notes. It is the first of three preprints going up on arXiv this month, arXiv 2604.00045, with The Collision Transform and The Collision Spectrum beside it.

The paper proves four such laws, in any base bbb. Exactly b−1b-1b−1 multipliers send every remainder to a different digit bin. The collision deviation at lag ℓ\ellℓ is fixed by the last ℓ+1\ell+1ℓ+1 digits of the denominator, and no fewer digits will do. Reflection pairs each ending with its complement so that the two values add to −1-1−1, which puts the average at exactly −1/2-1/2−1/2. Underneath that, every interior interval splits the unit classes exactly in half. All four come out of one change of coordinates, in which multiplying by the base turns the digit bins into ordinary congruence classes. For most of them neither a prime nor a primitive root is needed.

Watch the narrated slides

I walk through the argument in sixteen slides, from a pair of matching digits to the finite table and its reflection law.

The Collision Invariant, narrated by Alexander S. Petty. Sixteen slides, 13 min 10 sec.
Another video presentation I’m trying out

I tried Gemini Notebook’s new video capability on this paper, and it did a pretty good job. Many of the animated illustrations are generic, though. They look fine, but they don’t explain the mathematics being discussed. With more control over what the pictures actually show, this could become a useful tool for presenting research before long.

An alternate video presentation of The Collision Invariant, 6 min 33 sec.

One table, three papers

The path through the notes runs from Three and the Golden Ratio and The Cross-Alignment Matrix, through digit bins and The Collision Periodic Table, to character sums and LLL-functions. The three preprints put it into one argument. The first fixes the finite object and the rules it obeys, the second resolves it into characters and samples it at primes, and the third factors the characters and finds the LLL-values inside.

Three panels follow a base-five collision table through the trilogy. Twenty signed cells become a character-magnitude plot with eight active components. Eight squares show the relative fourth powers of the corresponding L-values. Three panels follow a base-five collision table through the trilogy. Twenty signed cells become a character-magnitude plot with eight active components. Eight squares show the relative fourth powers of the corresponding L-values.
One base-five table through the three preprints, its twenty entries, its eight surviving character coefficients, and squares scaling with |L(1, χ)|⁴.

The figure follows one base-five table through all three. At the top are its twenty entries modulo 252525, the values that repeat however large the denominator grows. In the middle, once each column is centered, only eight of the twenty character coefficients are left standing, with the tallest pairs at 333 and 171717, then 111 and 191919. At the bottom each surviving character becomes a square whose area scales with ∣L(1,χ)∣4|L(1,\chi)|^4∣L(1,χ)∣4, and the squares add to 192π4/625192\pi^4/625192π4/625. Everything below the top row belongs to the other two papers. This one stays with the table.

A collision at thirteen

The basic event is easy to watch. Divide 444 by 131313 and 555 by 131313,

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,​

and both decimals begin with 333, so the remainders 444 and 555 sit in the same digit bin. Multiply the remainder 555 by 666 and reduce modulo 131313,

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

and it lands on 444, still in bin 333. That is a collision, a multiplier carrying a remainder to another remainder with the same leading digit.

A twelve-node remainder circle shows every multiplication-by-six move modulo thirteen. Two arrows are highlighted, from five to four and eight to nine. Beneath it, the matching leading digits are boxed in the four repeating decimal blocks. A twelve-node remainder circle shows every multiplication-by-six move modulo thirteen. Two arrows are highlighted, from five to four and eight to nine. Beneath it, the matching leading digits are boxed in the four repeating decimal blocks.
Multiplication by six on the twelve remainders modulo thirteen. Only two arrows keep the leading digit, 5 to 4 in bin 3 and 8 to 9 in bin 6.

On the circle, multiplying by six sends each of the twelve remainders somewhere else, and the gray arrows nearly all change the outer digit. Only two arrows keep it, the gold one from 555 to 444 inside bin 333 and the teal one from 888 to 999 inside bin 666. The decimals underneath show the same pairs, 5/135/135/13 and 4/134/134/13 both starting with 333, 8/138/138/13 and 9/139/139/13 both starting with 666. So C13(6)=2C_{13}(6)=2C13​(6)=2.

Bins into classes

The digit a remainder rrr writes next in base bbb is

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

which rounds down, so 40/1340/1340/13 and 50/1350/1350/13 both give 333. Multiply each remainder by the base and reduce, and the bins turn into something more familiar.

Ten colored lanes follow the twelve remainders modulo thirteen to their new labels under multiplication by ten. Members of each lane have the same final decimal digit after relabeling. The two-member lanes for digits three and six are highlighted. Ten colored lanes follow the twelve remainders modulo thirteen to their new labels under multiplication by ten. Members of each lane have the same final decimal digit after relabeling. The two-member lanes for digits three and six are highlighted.
Every digit bin at thirteen, before and after multiplication by ten. Bin 3 holds 4 and 5 and becomes the class ending in 1.

Each row of the figure is one digit bin at thirteen, with its old remainders on the left and their images under multiplication by ten on the right. Bin 333 holds 444 and 555, and they go to 111 and 111111, which both end in 111. Bin 666 holds 888 and 999 and goes to 222 and 121212, both ending in 222. Every bin keeps its members together and picks up a new name, the last digit they now share. Interval boundaries have become a test of congruence, which is far easier to count with.

Long division explains it. Write 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), and ppp is invertible modulo bbb, so the digit and the last digit of xxx determine each other. The same linearization works for any denominator NNN coprime to bbb, prime or not, using every remainder from 111 to N−1N-1N−1, even those no single repeating block visits.

Nine empty multipliers

At thirteen, multiplication by 666 gives two collisions and so does multiplication by 111111. Every other multiplier except the identity 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
Four complete collision plots at primes thirteen, twenty-nine, eighty-three, and one thousand nine show increasing numbers of multipliers. Each plot has exactly nine gold zero markers. The same nine rational fractions are displayed underneath. Four complete collision plots at primes thirteen, twenty-nine, eighty-three, and one thousand nine show increasing numbers of multipliers. Each plot has exactly nine gold zero markers. The same nine rational fractions are displayed underneath.
Decimal collision counts for every multiplier at 13, 29, 83 and 1009. The gold dots are the zeros, nine each time, given by the nine fractions below.

The gold dots along the bottom of each panel are the zeros. There are nine at 131313, nine at 292929, nine at 838383, and at 100910091009, with more than a thousand multipliers and counts reaching 182182182, still nine. Bin Derangements and the Gate Width Theorem gave the whole list, and the nine fractions printed under the panels are that list. For any prime p>bp>bp>b, the collision-free multipliers are

g≡−ub−u(modp),1≤u<b,\begin{gathered} g\equiv-\frac{u}{b-u}\pmod p,\\ 1\leq u<b, \end{gathered}g≡−b−uu​(modp),1≤u<b,​

which are b−1b-1b−1 distinct residues fixed before the prime is chosen. In decimal, u=1u=1u=1 gives −1/9-1/9−1/9, which is 101010 modulo 131313, and the middle choice u=5u=5u=5 gives −5/5=−1-5/5=-1−5/5=−1. In an even base that multiplier sends digit ddd to b−1−db-1-db−1−d, and since no digit is its own complement, every remainder leaves its bin. The same count shows that every collision count is even, because each collision comes with a partner displaced the opposite way.

The list is complete

For a nonidentity multiplier ggg, let ccc be the integer from 1 to p−1p-1p−1 satisfying

c(1−g)≡b(modp).c(1-g)\equiv b\pmod p.c(1−g)≡b(modp).

The value c=bc=bc=b would require g=0g=0g=0, so it is excluded. Put Q=⌊(p−1)/b⌋Q=\lfloor(p-1)/b\rfloorQ=⌊(p−1)/b⌋. In the new coordinates, a collision has displacement jbjbjb or −jb-jb−jb. Each successful positive displacement has a reflected partner. Counting both gives

Cp(g)=2#{1≤j≤Q:[jc]p>jb},C_p(g)=2\#\{1\leq j\leq Q:[jc]_p>jb\},Cp​(g)=2#{1≤j≤Q:[jc]p​>jb},

where [jc]p[jc]_p[jc]p​ is the least nonnegative residue.

If c<bc<bc<b, then jc≤Q(b−1)<pjc\leq Q(b-1)<pjc≤Q(b−1)<p and jc<jbjc<jbjc<jb. Every test fails. If c>bc>bc>b, the first test passes. Thus precisely c=1,…,b−1c=1,\ldots,b-1c=1,…,b−1 give zero. Solving for ggg and setting u=b−cu=b-cu=b−c gives the displayed rational family. The same count proves that every nonidentity collision count is even, and the identity contributes the even number p−1p-1p−1.

The last two digits

Fix the multiplier at ten. One multiplication now advances long division by one digit, and a collision means the first two digits of a fraction agree. At 109109109 there are 181818 collisions against a smaller bin size of ⌊108/10⌋=10\lfloor108/10\rfloor=10⌊108/10⌋=10, a difference of 888. At 209209209 there are 282828, less 202020, and again 888, even though 209=11×19209=11\times19209=11×19 is composite.

Two hundred-cell grids show the first two decimal digit bins for denominators one hundred nine and two hundred nine. Dots count the fractions in each cell. The ten equal-digit cells lie on the gold diagonal. Two hundred-cell grids show the first two decimal digit bins for denominators one hundred nine and two hundred nine. Dots count the fractions in each cell. The ten equal-digit cells lie on the gold diagonal.
The hundred boxes at 109 and at 209, with the matching diagonal in gold. Every box gains one dot, so 18 − 10 and 28 − 20 both leave 8.

Each box in the figure is one hundredth of the unit interval, labeled by the first two digits of the fractions inside it. The gold boxes on the diagonal are the ones with equal digits. Going from 109109109 to 209209209 drops one more dot into every box, the ninety plain ones and the ten gold ones alike. The collision count rises by ten and the baseline by ten, so the difference stays at 888. That difference is the collision invariant,

S(N)=CN(10)−⌊N−110⌋,S(N)=C_N(10)-\left\lfloor\frac{N-1}{10}\right\rfloor,S(N)=CN​(10)−⌊10N−1​⌋,

and the subtracted baseline sets the scale of a digit bin.

Denominator Collisions Baseline Difference
109 18 10 8
209 28 20 8
409 48 40 8
1009 108 100 8

For N>100N>100N>100 coprime to ten, the last two digits of NNN determine S(N)S(N)S(N), and all forty possible endings fit in The Collision Periodic Table. No primality test enters the lookup. At lag ℓ\ellℓ, the first and last digits of an (ℓ+1)(\ell+1)(ℓ+1)-digit block must agree, the table lives modulo bℓ+1b^{\ell+1}bℓ+1, and the last ℓ+1\ell+1ℓ+1 base-bbb digits of NNN suffice once N>bℓ+1N>b^{\ell+1}N>bℓ+1. One digit fewer won’t do. In decimal at lag one, 010101 and 919191 both end in 111, yet their values are 000 and −9-9−9.

The finite formula, including the endpoint

Put B=bℓB=b^\ellB=bℓ and m=bBm=bBm=bB. Let GGG contain the integers nnn from 0 to m−1m-1m−1 whose first and last base-bbb digits agree. It has BBB members. Write N=mt+aN=mt+aN=mt+a, where aaa is a unit modulo mmm.

Each selected interval contributes

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

The last interval includes the excluded endpoint NNN, so subtract one. The BBB copies of ttt cancel those in the baseline, leaving

Sℓ(a)=−1−⌊ab⌋+∑n∈Gdn(a),dn(a)=⌊(n+1)am⌋−⌊nam⌋.\begin{aligned} S_\ell(a)&=-1-\left\lfloor\frac ab\right\rfloor +\sum_{n\in G}d_n(a),\\ d_n(a)&=\left\lfloor\frac{(n+1)a}{m}\right\rfloor -\left\lfloor\frac{na}{m}\right\rfloor. \end{aligned}Sℓ​(a)dn​(a)​=−1−⌊ba​⌋+n∈G∑​dn​(a),=⌊m(n+1)a​⌋−⌊mna​⌋.​

The exact obstruction to a smaller base power is also uniform. The classes 111 and m−B+1m-B+1m−B+1 agree modulo BBB, yet

Sℓ(1)=0,Sℓ(m−B+1)=−(b−1)bℓ−1.\begin{aligned} S_\ell(1)&=0,\\ S_\ell(m-B+1)&=-(b-1)b^{\ell-1}. \end{aligned}Sℓ​(1)Sℓ​(m−B+1)​=0,=−(b−1)bℓ−1.​

The Collision Invariant derives both values from the same floor formula.

The other half of 09

The ending 090909 carries +8+8+8. Reflect it across 100100100 to 919191 and the value is −9-9−9, so the two add to −1-1−1.

Twenty horizontal segments connect the collision values of each reflected pair of decimal endings. Every segment is centered at minus one half. Below, two rows of filled and empty boxes show the complementary interior crossings for endings zero-nine and ninety-one. Twenty horizontal segments connect the collision values of each reflected pair of decimal endings. Every segment is centered at minus one half. Below, two rows of filled and empty boxes show the complementary interior crossings for endings zero-nine and ninety-one.
All forty decimal endings joined to their reflections, every line centered at −1/2. Below, the ten matching intervals for 09 and 91.

In the top panel each of the twenty lines joins an ending to its partner, teal on the left and violet on the right. Every line is centered on the dashed mark at −1/2-1/2−1/2. The long line from 090909 to 919191 balances there exactly as the short lines near the middle do. Twenty pairs each adding to −1-1−1 give a total of −20-20−20 and an average of −1/2-1/2−1/2. The row of boxes below shows the reason for 090909 and 919191. Of the ten matching intervals, 090909 crosses a hundred boundary in nine, every interior box filled, and 919191 crosses only in the last. The interior boxes trade places between the two, while the endpoints stay put. The first box is empty for both and the last is filled for both, and that shared endpoint is where the −1-1−1 comes from.

This is the reflection identity, true in any base at any positive lag. With m=bℓ+1m=b^{\ell+1}m=bℓ+1,

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

Read all forty values

The row gives the tens digit; the column gives the final digit. Read row 0, column 9 for ending 09.

Tens digit Final 1 Final 3 Final 7 Final 9
0 0 2 0 8
1 -1 -1 1 -1
2 0 -2 6 0
3 -1 -1 -3 -1
4 -4 0 -2 0
5 -1 1 -1 3
6 0 2 0 0
7 -1 -7 1 -1
8 0 -2 0 0
9 -9 -1 -3 -1

There is a smaller balance inside each entry. Take interval 111111. At a=9a=9a=9 the step from 11a11a11a to 12a12a12a runs from 999999 to 108108108 and crosses 100100100. At a=91a=91a=91 it runs from 100110011001 to 109210921092 and stops short of 110011001100. Across the forty unit classes modulo 100100100, exactly twenty cross at interval 111111, and the same twenty-twenty split holds at every interior interval from 111 to 989898, even as the crossing half changes membership. This half-group law holds for every modulus m≥3m\geq3m≥3, whether or not it is a power of a base.

Every crossing, from nine positions to a thousand
Six exact binary matrices show every interior floor crossing at moduli nine, twenty-five, one hundred, one hundred one, six hundred twenty-five, and one thousand. Small checker patterns become densely interlaced curves. Exactly half of each row is gold. Six exact binary matrices show every interior floor crossing at moduli nine, twenty-five, one hundred, one hundred one, six hundred twenty-five, and one thousand. Small checker patterns become densely interlaced curves. Exactly half of each row is gold.
Every crossing at every interior interval for the displayed moduli, 725,022 cells in all, gold where the step crosses and teal where it doesn’t.
The endpoint arithmetic behind the offset

For an interior index, complementary floors give dn(a)+dn(m−a)=1d_n(a)+d_n(m-a)=1dn​(a)+dn​(m−a)=1. At the first and last indices the totals are 0 and 2. Both endpoints belong to the selected diagonal, whose other B−2B-2B−2 members each contribute 1. Also

⌊ab⌋+⌊m−ab⌋=B−1.\left\lfloor\frac ab\right\rfloor+ \left\lfloor\frac{m-a}{b}\right\rfloor=B-1.⌊ba​⌋+⌊bm−a​⌋=B−1.

Add the two finite formulas,

Sℓ(a)+Sℓ(m−a)=−2−(B−1)+0+2+(B−2)=−1.\begin{aligned} &S_\ell(a)+S_\ell(m-a)\\ &\quad=-2-(B-1)\\ &\qquad+0+2+(B-2)\\ &\quad=-1. \end{aligned}​Sℓ​(a)+Sℓ​(m−a)=−2−(B−1)+0+2+(B−2)=−1.​

For the half-group law, the crossing test is [(n+1)a]m<a[(n+1)a]_m<a[(n+1)a]m​<a. Neither equality nor a zero residue is possible when aaa is a unit and 1≤n≤m−21\leq n\leq m-21≤n≤m−2. Replacing aaa by m−am-am−a reverses the strict inequality. It pairs every crossing with exactly one noncrossing.

The bins, the boxes and the crossing, up close
The digit bins modulo thirteen and their transformed congruence classes. Each original group remains intact under multiplication by ten.
The digit bins at thirteen and their congruence classes after multiplication by ten.
The equal-digit intervals in the hundred-piece partition, and the increase in their population when the denominator grows by one hundred.
The equal-digit boxes in the hundred-box partition, and their growth when the denominator rises by one hundred.
The step from 99 to 108 crosses a hundred boundary. Its reflected step from 1001 to 1092 does not.
The step from 99 to 108 crosses a hundred, and its reflected step from 1001 to 1092 doesn’t.

The paper ends with a table that no longer grows with the denominator. At lag ℓ\ellℓ it has one entry for each unit modulo bℓ+1b^{\ell+1}bℓ+1, and every reflected pair adds to −1-1−1. Every interior interval crosses for exactly half the units, and primes and composites read the same values. In decimal at lag one that is forty numbers averaging −1/2-1/2−1/2, from +8+8+8 at 090909 down to −9-9−9 at 919191.

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 →