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

Digit-Partitioning Primes and the Alignment Formula

April 3, 202014 min read
Companion paper: Digit-Partitioning Primes and the Alignment Formula →
Digit-Partitioning Primes and the Alignment Formula
The digit function assigns each remainder to a seat. At p = 3, 7, and 11, every remainder has its own. At p = 13, some seats hold two, and collisions begin.

Write out all ten fractions of 11. Read down the columns.

 1/11 => 0.|09|
 2/11 => 0.|18|
 3/11 => 0.|27|
 4/11 => 0.|36|
 5/11 => 0.|45|
 6/11 => 0.|54|
 7/11 => 0.|63|
 8/11 => 0.|72|
 9/11 => 0.|81|
10/11 => 0.|90|

Ten fractions. Ten two-digit blocks. Every digit appears exactly once in each column. The first runs from 0 to 9. The second runs back from 9 to 0. Continue the division as far as you like. No two rows share a digit at the same position.

The bars enclose the shortest repeating block. |09| means 090909..., continuing indefinitely.

Now try 13.

 1/13 => 0.|076923|     7/13 => 0.|538461|
 2/13 => 0.|153846|     8/13 => 0.|615384|
 3/13 => 0.|230769|     9/13 => 0.|692307|
 4/13 => 0.|307692|    10/13 => 0.|769230|
 5/13 => 0.|384615|    11/13 => 0.|846153|
 6/13 => 0.|461538|    12/13 => 0.|923076|

Read the first digits in numerator order. 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9. The digits 3 and 6 each appear twice. Twelve fractions, but only ten possible digits.

Somewhere between these two tables, complete separation becomes impossible. The boundary can be located exactly.

The digit function and the boundary

Think of the digits 0 through 9 as ten chairs in a row. Each nonzero remainder needs a seat. Long division decides where it sits.

For a prime denominator ppp in base bbb, the digit produced by remainder rrr is

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

Multiply the remainder by the base and divide by ppp. The whole-number quotient is the next digit. The remainder of that division is the starting point for the next step. The floor brackets pick out the digit.

At 11 in base ten, remainder 1 produces digit 0, remainder 2 produces digit 1, and so on through remainder 10, which produces digit 9. The rule is δ(r)=r−1\delta(r)=r-1δ(r)=r−1. Every chair is taken, once.

This is the endpoint case p=b+1p=b+1p=b+1. For a smaller prime ppp that does not divide the base, increasing rrr by one increases br/pbr/pbr/p by more than one. Taking integer parts keeps the values separate. For p>b+1p>b+1p>b+1, the p−1p-1p−1 nonzero remainders outnumber the bbb digits. Some must share.

Among primes not dividing the base, the digit map is therefore injective precisely when

p≤b+1.p\leq b+1.p≤b+1.

Injective means that different remainders produce different digits. I call the primes satisfying this condition digit-partitioning. In base ten they are 3, 7, and 11. The primes 2 and 5 divide the base and produce terminating expansions, so they are excluded.

Two remainders at 3, six at 7, ten at 11. Each has its own digit. At 13, the digits 3 and 6 each receive two remainders.
Two remainders at 3, six at 7, ten at 11. Each has its own digit. At 13, the digits 3 and 6 each receive two remainders.

Now advance every row by one digit. Multiplication by the base permutes the nonzero remainders modulo ppp. Distinct remainders stay distinct. If the digit map separates them in the first column, it separates them in the second, and in every column after that. One step of long division is enough to prove separation throughout the repetend.

Three mechanisms

Start with 3.

1/3 => 0.|3|
2/3 => 0.|6|

Each remainder returns to itself after one step. The two digits repeat forever. Showing three copies as |333| instead of |3| gives the same decimal. Its shortest repeating block is still one digit.

Now 7.

1/7 => 0.|142857|
2/7 => 0.|285714|
3/7 => 0.|428571|
4/7 => 0.|571428|
5/7 => 0.|714285|
6/7 => 0.|857142|

Take 142857 and multiply it by 2. You get 285714. Multiply it by 3 and you get 428571. Each is a rotation of the same six-digit block. The six nonzero remainders form one cycle, visiting every remainder before returning to the start.

Read the columns instead of the rows. Every column contains six different digits. The rotations stay separate at every position.

And 11, back at the opening table. 09 becomes 90, 18 becomes 81, 27 becomes 72. Five pairs, each returning after two steps. Multiplication by ten modulo eleven sends remainder rrr to 11−r11-r11−r, then brings it back. Each pair of digits sums to nine.

Single digits, a full cycle, complement pairs. The repeating blocks take different forms. In all three tables, every digit in a column belongs to just one row.

One formula

Take denominator 12 and compare its eleven fractions with 1/121/121/12.

Start every row after the second decimal place. By then the factor 4 in 12=3⋅412=3\cdot412=3⋅4 has cleared. The tails fall into three groups.

Numerators over 12 Tail after two places Number of rows
3, 6, 9 Terminating 3
1, 4, 7, 10 Repeating 3, matching the reference 4
2, 5, 8, 11 Repeating 6 4

For the alignment score, I give a terminating row a score of 1. A repeating row is scored by the fraction of positions that agree with the reference. Here the four repeating-3 rows score 1 and the four repeating-6 rows score 0. The average is

3+411=711.\frac{3+4}{11}=\frac7{11}.113+4​=117​.

We keep the same starting column for every fraction. With longer repeating blocks, restarting each row at the end of its own prefix can change which digits are compared. The count uses one shared division clock.

Now replace 12 by pmpmpm, where mmm is built from the base’s own prime factors. In decimal, mmm can contain only twos and fives, or be 1. These are the base-supported factors. Enough division steps clear them from the denominator.

The same three groups appear. There are m−1m-1m−1 terminating rows. There are mmm rows whose synchronized tails match the reference at every position. If ppp is digit-partitioning, the remaining (p−2)m(p-2)m(p−2)m rows disagree at every position. Their remainders are different from the reference, and the digit map keeps those remainders separate.

Among the repeating tails, agreement is all or nothing. There are no partial matches to add. The average is

αb(pm)=(m−1)+mpm−1=2m−1pm−1.\alpha_b(pm)=\frac{(m-1)+m}{pm-1}=\frac{2m-1}{pm-1}.αb​(pm)=pm−1(m−1)+m​=pm−12m−1​.

The count uses neither the length of a cycle nor the number of cycles. That is how 3, 7, and 11 arrive at the same formula.

Different bases, same formula

Change the base and the digit-partitioning primes change with it. Base six has 5 and 7. Base sixteen has 3, 5, 7, 11, 13, and 17. In each case, take the primes at most b+1b+1b+1 and exclude those that divide bbb.

The tables change. The formula (2m−1)/(pm−1)(2m-1)/(pm-1)(2m−1)/(pm−1) does not. At a prime endpoint p=b+1p=b+1p=b+1, the complement pairs return too. Their digits sum to 5 in base six and 15 in base sixteen, for the same reason they sum to 9 in decimal.

These repeating structures have a history. Armstrong and Armstrong studied repetends across bases, and Lewittes developed Midy’s theorem for periodic decimals. Comparing digits at corresponding positions belongs to the Hamming-correlation setting studied by Lempel and Greenberger. Kak and Chatterjee studied full-period reciprocal digit sequences, including complement structure, Hamming distances, and autocorrelation bounds.

The result here puts the exact digit-separation boundary together with a count across the whole denominator table. The base need not generate every nonzero remainder in one cycle. The formula includes both the single orbit at 7 and the five separate pairs at 11.

The golden ratio, again

As mmm grows through supported values, the alignment approaches 2/p2/p2/p. To exceed the golden threshold 1/φ≈0.6181/\varphi\approx0.6181/φ≈0.618, where φ=(1+5)/2\varphi=(1+\sqrt5)/2φ=(1+5​)/2, the limiting value must satisfy

2p>1φ,or equivalentlyp<2φ≈3.236.\frac2p>\frac1\varphi, \qquad\text{or equivalently}\qquad p<2\varphi\approx3.236.p2​>φ1​,or equivalentlyp<2φ≈3.236.

At 3, the limit is 2/3≈0.6672/3\approx0.6672/3≈0.667. At 7 it is 2/7≈0.2862/7\approx0.2862/7≈0.286, and at 11 it is 2/11≈0.1822/11\approx0.1822/11≈0.182. Only 3 lies above the threshold. The score at denominator 12, 7/117/117/11, already crosses it.

At fixed mmm, there are 2m−12m-12m−1 aligned rows in each case. They are spread across 3m−13m-13m−1, 7m−17m-17m−1, or 11m−111m-111m−1 rows. The proportion falls as ppp increases.

In any base where 3 is admissible, it is the only prime at least 3 whose limiting alignment exceeds the golden threshold. If the base is divisible by 3, it is excluded. Odd bases also admit the prime 2, whose alignment is identically 1.

Where the collisions begin

Return to the chairs. At 3, two are occupied. At 7, six. At 11, all ten, with one remainder in each. At 13, twelve remainders have to fit into the same ten places. The digits 3 and 6 each receive two.

Every prime beyond 11 has digit collisions in base ten. The floor map still tells us exactly where the remainders go.

Beyond 11, digit bins begin to hold several remainders. The lower plot counts the pairs that share a digit.
Beyond 11, digit bins begin to hold several remainders. The lower plot counts the pairs that share a digit.

Look at two rows from the table of 13.

 1/13 => 0.|076923|
11/13 => 0.|846153|

Their third digits are both 6. Their sixth digits are both 3. The two tails agree in two of their six positions, then repeat that pattern indefinitely.

At 11, every repeating row either matched the reference completely or missed it completely. At 13, this row scores a third. The average now includes agreements that the three-group count does not record.

The single digits at 3, the rotation at 7, and the complement pairs at 11 still have their own character. The alignment formula lets us count all three in the same way because different remainders stay visible as different digits. We do not have to follow each cycle around to know how often two tails agree. At 13, the shared 6 and the shared 3 show exactly what that shortcut leaves out.

That is the connection I wanted to draw between these familiar decimals. Their repeating blocks look different, but one property of long division explains the count they share. It was there in the opening table of 11, before we had a name or a formula for it. Read down any column. Every remainder has a digit of its own.

Companion paper: Digit-Partitioning Primes and the Alignment Formula →
Share

Discussion

Sign in to join the discussion.

← All articlesRead the paper →
← Previous: Three and the Golden Ratio
Next: The Alignment Limit for All Primes →