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

Bin Derangements and the Gate Width Theorem

July 4, 202216 min read
Companion paper: Bin Derangements and the Gate Width Theorem →
Colored arcs and points cross a row of vertical light-filled columns, from orange through blue to violet.
The digit bins fill as the prime grows. For primes greater than ten, the zero set still comes from the same nine fractions.

Write the twelve fractions from 1/131/131/13 through 12/1312/1312/13. Read their first decimal digits. Two rows begin with three.

4/13 = 0.307692...
5/13 = 0.384615...

Two others, 8/138/138/13 and 9/139/139/13, begin with six. Every other first digit belongs to just one row. Group the numerators by that digit and we have ten bins. Eight hold one number. Two hold two.

Multiply every numerator by six and take the remainder after division by thirteen. Five becomes four, since 6⋅5=306\cdot5=306⋅5=30 leaves remainder four. Both fractions begin with three. Eight becomes nine. Both begin with six.

No other numerator keeps its first digit. Call the collision count C(g)C(g)C(g), where ggg is the multiplier. We have C(6)=2C(6)=2C(6)=2.

Try every multiplier from two through twelve. Set the identity aside. Multiplication by one leaves all twelve rows alone.

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

Nine zeros. Each of those nine multipliers moves every numerator out of its original digit bin. I call it bin deranging.

Nine at p=13p=13p=13. Nine at p=29p=29p=29. Nine at p=83p=83p=83. Nine at p=1009p=1009p=1009.

Collision counts for every nonidentity multiplier at primes thirteen, twenty-nine, eighty-three and 1009 in base ten. Teal stems show the count divided by p minus one. Gold marks the nine exact zeros in each field. Collision counts for every nonidentity multiplier at primes thirteen, twenty-nine, eighty-three and 1009 in base ten. Teal stems show the count divided by p minus one. Gold marks the nine exact zeros in each field.
The vertical scale is the same in all four panels. The multiplier range changes. Gold marks integer counts of zero, not small values rounded down. Neighboring markers can merge at reading size.

At thirteen, only two nonidentity multipliers remain outside the zero set. At a thousand and nine, there are 998. Yet the number with no collisions is still nine.

In base seven, the count is six for every prime greater than seven. In base three, it is two. For every integer base b≥2b\ge2b≥2 and every prime p>bp>bp>b, there are exactly b−1b-1b−1 bin-deranging multipliers. This is the gate width theorem.

Phase-Filtered Ramanujan Sums and the Spectral Gate expresses these zeros through spectral cancellation. Here we can name them before computing a spectrum.

A list before the prime

In base ten, the entire zero set comes from nine fixed fractions. The first is −1/9-1/9−1/9. The last is −9-9−9, with −1-1−1 in the middle.

These are fractions in modular arithmetic. The fraction −1/9-1/9−1/9 modulo thirteen means the number that gives −1-1−1 when multiplied by nine. That number is ten, since 9⋅10=909\cdot10=909⋅10=90 is one less than a multiple of thirteen. At prime twenty-nine, the same fraction gives sixteen, since 9⋅16=1449\cdot16=1449⋅16=144 is one less than a multiple of twenty-nine.

The fraction stays fixed. Its residue changes with the prime.

Nine rational numbers down the left and their residues at primes thirteen, twenty-nine, eighty-three and 1009 across the four columns. Each column gives the complete zero set. The middle row, negative one, is highlighted. Nine rational numbers down the left and their residues at primes thirteen, twenty-nine, eighty-three and 1009 across the four columns. Each column gives the complete zero set. The middle row, negative one, is highlighted.
Read down a prime’s column to get its nine zero multipliers. Read across to follow one fixed fraction through four fields. Rows equidistant from the middle give inverse multipliers.

For a general base, run uuu from one through b−1b-1b−1. The list is

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

Every denominator is smaller than ppp, so every division is defined. The resulting multipliers are distinct. These are all the zeros.

Read the list from opposite ends. The first and last fractions multiply to one. So do the second and second-last. In the formula, uuu and b−ub-ub−u give inverse multipliers. Undoing a bin derangement is another bin derangement.

For an even base, the middle fraction is −1-1−1. It sends digit ddd to b−1−db-1-db−1−d. No digit is its own complement in an even base. Decimal pairs zero with nine, one with eight, and so on. In an odd base, the middle digit is its own complement, so this argument does not give a derangement.

From first digits to last digits

The bins are intervals of numerators. Multiplication modulo a prime scatters them. A change of labels makes them easier to follow.

Replace each numerator rrr by the remainder of 10r10r10r divided by thirteen. The pair four and five becomes one and eleven. The pair eight and nine becomes two and twelve.

At thirteen, numerators four and five in the first-digit-three bin become transformed remainders one and eleven, sharing last digit one. Numerators eight and nine in the first-digit-six bin become two and twelve, sharing last digit two. At thirteen, numerators four and five in the first-digit-three bin become transformed remainders one and eleven, sharing last digit one. Numerators eight and nine in the first-digit-six bin become two and twelve, sharing last digit two.
The digit labels change, but the pairs stay together. Multiplying the numerators by the base turns each first-digit bin into a last-digit congruence class.

A shared first digit has become a shared last digit. The digit itself need not stay the same. What stays the same is which numbers belong together.

To see why, use base bbb and write x=[br]px=[br]_px=[br]p​. The brackets mean take the remainder between one and p−1p-1p−1. If ddd is the first digit of r/pr/pr/p, long division says

br=pd+x.br=pd+x.br=pd+x. x≡−pd(modb).x\equiv-pd\pmod b.x≡−pd(modb).

The prime p>bp>bp>b is coprime to the base. Multiplication by −p-p−p therefore permutes the digit classes modulo bbb. Two first digits agree exactly when their transformed remainders have the same last digit.

Multiplication by ggg also survives the relabeling. The transformed image of [gr]p[gr]_p[gr]p​ is [gx]p[gx]_p[gx]p​. A collision is now exactly

x≡[gx]p(modb).x\equiv[gx]_p\pmod b.x≡[gx]p​(modb).

Multiply, reduce modulo the prime, then compare modulo the base. We can now look for numbers separated by whole multiples of bbb.

The two sides of ten

Give each nonidentity multiplier a label ccc between one and p−1p-1p−1 by solving

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

The label bbb is excluded because it would give g=0g=0g=0. Every other label occurs exactly once. The reverse rule is g≡1−b/c(modp)g\equiv1-b/c\pmod pg≡1−b/c(modp).

Labels below the base give no collisions. Labels above the base always give a collision. We can prove both statements without examining a table.

Suppose a collision exists. Put y=[gx]py=[gx]_py=[gx]p​. Since xxx and yyy agree modulo bbb, we can write y=x+mby=x+mby=x+mb for an integer mmm. They are distinct because g≠1g\ne1g=1. Multiplying the relation mb≡(g−1)xmb\equiv(g-1)xmb≡(g−1)x by ccc gives

mbc≡−bx(modp).mbc\equiv-bx\pmod p.mbc≡−bx(modp). x+mc≡0(modp).x+mc\equiv0\pmod p.x+mc≡0(modp).

Now suppose 0<c<b0<c<b0<c<b. Stepping by ccc takes us only part of the way that stepping by bbb does. The number x+mcx+mcx+mc lies strictly between xxx and yyy, whether mmm is positive or negative.

Two schematic number lines inside the interval from zero to p. For positive and negative m, the intermediate point z equals x plus mc and lies strictly between x and y whenever zero is less than c and c is less than b. There is no multiple of p in the interval. Two schematic number lines inside the interval from zero to p. For positive and negative m, the intermediate point z equals x plus mc and lies strictly between x and y whenever zero is less than c and c is less than b. There is no multiple of p in the interval.
The two possible orders of the endpoints. The gold point is a weighted average of x and y with both weights positive. It cannot be a multiple of p. This is the contradiction, not a pictured example of a collision.

Both endpoints lie in the open interval (0,p)(0,p)(0,p). That interval contains no multiple of ppp. The required divisibility is impossible.

That settles every label below the base.

Above the base, write down a match. For c>bc>bc>b, take

x=p−c,y=x+b.x=p-c,\qquad y=x+b.x=p−c,y=x+b.

Both lie between one and p−1p-1p−1, and they agree modulo bbb. The defining equation gives (1−g)x≡−b(modp)(1-g)x\equiv-b\pmod p(1−g)x≡−b(modp), so [gx]p=x+b=y[gx]_p=x+b=y[gx]p​=x+b=y.

At thirteen, multiplier six has label eleven. The construction gives x=2x=2x=2 and y=12y=12y=12. Undo the substitution and they become eight and nine, the collision at the opening.

For multiplier six at thirteen, c is eleven. The explicit witness x equals thirteen minus eleven, or two, and y equals x plus ten, or twelve. Six times two is twelve. Undoing multiplication by ten sends two to eight and twelve to nine. For multiplier six at thirteen, c is eleven. The explicit witness x equals thirteen minus eleven, or two, and y equals x plus ten, or twelve. Six times two is twelve. Undoing multiplication by ten sends two to eight and twelve to nine.
The proof supplies a collision for every label above the base. At c equal to eleven, it recovers the original move from eight to nine under multiplier six.

Every nonidentity multiplier is on one side or the other. The zero labels are exactly 1,2,…,b−11,2,\ldots,b-11,2,…,b−1. Substitute c=b−uc=b-uc=b−u into g=1−b/cg=1-b/cg=1−b/c and we recover −u/(b−u)-u/(b-u)−u/(b−u). The count and the list come from the same argument.

The scattered zeros line up

The left-hand tables order multipliers numerically. The right-hand tables order them by ccc. Columns stay fixed. No comparison is added or removed.

Integer collision tables at primes thirteen, eighty-three and 1009, each shown twice. Columns are transformed remainders x. Rows run by multiplier g on the left and label c on the right. Colors name the shared last decimal digit. Nine empty rows are marked in gold. Relabeling places them together at the bottom; every higher row has a match. Integer collision tables at primes thirteen, eighty-three and 1009, each shown twice. Columns are transformed remainders x. Rows run by multiplier g on the left and label c on the right. Colors name the shared last decimal digit. Nine empty rows are marked in gold. Relabeling places them together at the bottom; every higher row has a match.
The same cells, with only their rows reordered. The identity is omitted. On the right, labels one through nine form the empty band and label ten is skipped. Color names the transformed last digit. Open the full-size plate to inspect all 1,015,056 cells in each view of the largest table.

Columns are transformed remainders xxx. A colored cell means that xxx and [gx]p[gx]_p[gx]p​ share a last decimal digit. Color names that digit, not the original leading digit. The identity multiplier is omitted from both orders.

Gold marks the nine empty rows. On the right they become the bottom band, at labels one through nine. Label ten is omitted because it would give multiplier zero. Every row above the band contains a match.

The largest table has 1007⋅1008=1,015,0561007\cdot1008=1{,}015{,}0561007⋅1008=1,015,056 cells, shown in both orders. The full-size plate retains every one. The colors reveal the changing arrangement beyond the gate. The empty band does not grow.

When the multipliers are shifts of one repetend

The proof uses every nonzero remainder. It does not require the base to visit them all in one cycle.

If bbb is a primitive root modulo ppp, its powers visit all p−1p-1p−1 remainders. Multiplication by bℓb^\ellbℓ then compares a complete repetend with its shift by ℓ\ellℓ. Nonzero shifts and nonidentity multipliers correspond one to one, so exactly b−1b-1b−1 nonzero shifts have no digit matches.

On a shorter cycle, a shift can miss every digit there while producing collisions elsewhere. The full multiplier classification does not give the exact zero count on that shorter word.

The companion paper gives the formal statements and their relation to earlier work on sequence correlation.

Four matches, two ways

Return to the two crowded bins at thirteen. Inside the digit-three bin, we can go from four to five or from five to four. Inside the digit-six bin, we can go from eight to nine or from nine to eight.

Four ordered pairs. Each belongs to exactly one multiplier, namely the destination divided by the starting residue modulo thirteen.

Two two-by-two tables for bins four, five and eight, nine. Gray diagonal cells belong to the identity. Teal marks five to four and eight to nine under multiplier six. Gold marks four to five and nine to eight under multiplier eleven. Two two-by-two tables for bins four, five and eight, nine. Gray diagonal cells belong to the identity. Teal marks five to four and eight to nine under multiplier six. Gold marks four to five and nine to eight under multiplier eleven.
Each off-diagonal ordered pair has one multiplier. Two teal pairs and two gold pairs account for all four nonidentity collisions. Dividing by the two positive-count multipliers gives the mean of two.

A bin containing ndn_dnd​ residues has nd(nd−1)n_d(n_d-1)nd​(nd​−1) ordered pairs with distinct entries. Adding over bins counts every collision outside the identity. The zero multipliers contribute nothing. The remaining p−b−1p-b-1p−b−1 multipliers share the total, so their mean is

C‾=∑dnd(nd−1)p−b−1.\overline C=\frac{\sum_d n_d(n_d-1)}{p-b-1}.C=p−b−1∑d​nd​(nd​−1)​.

At thirteen, four matches divided between two multipliers gives a mean of two. At the boundary prime eleven, every bin is a singleton. All nonidentity multipliers are deranging, and there is no remaining set to average. The mean requires p>b+1p>b+1p>b+1.

At twenty-nine, eight bins hold three residues and two hold two. They supply 8⋅6+2⋅2=528\cdot6+2\cdot2=528⋅6+2⋅2=52 matches. Eighteen nonidentity multipliers lie outside the zero set, giving mean 52/18=26/952/18=26/952/18=26/9.

The mean from the bin sizes

Write p−1=bQ+Rp-1=bQ+Rp−1=bQ+R, with 0≤R<b0\le R<b0≤R<b. There are RRR bins of size Q+1Q+1Q+1 and b−Rb-Rb−R of size QQQ. Their ordered pairs total

∑dnd(nd−1)=R(Q+1)Q+(b−R)Q(Q−1)=Q(b(Q−1)+2R).\begin{aligned} \sum_d n_d(n_d-1) &=R(Q+1)Q\\ &\quad +(b-R)Q(Q-1)\\ &=Q\bigl(b(Q-1)+2R\bigr). \end{aligned}d∑​nd​(nd​−1)​=R(Q+1)Q+(b−R)Q(Q−1)=Q(b(Q−1)+2R).​

There are p−b−1=b(Q−1)+Rp-b-1=b(Q-1)+Rp−b−1=b(Q−1)+R multipliers to share those pairs. Thus

C‾=Q(b(Q−1)+2R)b(Q−1)+R.\overline C=\frac{Q\bigl(b(Q-1)+2R\bigr)}{b(Q-1)+R}.C=b(Q−1)+RQ(b(Q−1)+2R)​.

The mean equals two throughout b+1<p≤2b+1b+1<p\le2b+1b+1<p≤2b+1. In this range the bins have one or two members, apart from the endpoint where all have two. The only nonzero within-bin contributions are two per double bin. Their total is twice the number of nonidentity multipliers outside the gate.

When R=0R=0R=0 and the mean is defined, all bins have the same size QQQ and the formula reduces to C‾=Q\overline C=QC=Q.

The sum does not tell us how each individual multiplier behaves. It tells us exactly how many matches they have to share.

The fraction list, the relabeling, and the pairs

These wider plates place the four prime fields side by side, join the change of coordinates to its parameter line, and collect the ordered pairs inside the two crowded bins.

The nine fixed fractions across the columns, with their residues at four primes underneath. Each prime's row is its complete decimal zero set.
The nine fixed fractions across the columns, with their residues at four primes underneath. Each prime’s row is its complete decimal zero set.
The two crowded bins at thirteen become last-digit classes. The parameter line places all nine zero multipliers below ten and the two positive-count multipliers above it.
The two crowded bins at thirteen become last-digit classes. The parameter line places all nine zero multipliers below ten and the two positive-count multipliers above it.
The four ordered pairs with distinct entries in the crowded bins at thirteen. They divide evenly between multipliers six and eleven.
The four ordered pairs with distinct entries in the crowded bins at thirteen. They divide evenly between multipliers six and eleven.

At thirteen, the two crowded bins leave only four matches to distribute. Once the prime exceeds twice the base, every bin is crowded. More multipliers preserve a digit somewhere in the table.

But nine still preserve none. We can name them before making a single comparison. Reduce the same nine fractions modulo the chosen prime.

The base fixes the width of the gate. The prime fills in what happens beyond it.

Companion paper: Bin Derangements and the Gate Width Theorem →
Share

Discussion

Sign in to join the discussion.

← All articlesRead the paper →
← Previous: Phase-Filtered Ramanujan Sums and the Spectral Gate
Next: The Character Structure of the Collision Fluctuation →