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, 202013 min read
Companion paper: Digit-Partitioning Primes and the Alignment Formula →
Fine trajectories keep their order as the whole field opens and turns. Their separation suggests the partitioning condition: each digit still identifies a distinct remainder.
Fine trajectories keep their order as the whole field opens and turns. Their separation suggests the partitioning condition: each digit still identifies a distinct remainder.

The count in Three and the Golden Ratio came out so cleanly that I began to wonder how much luck was in it. Seven of the eleven twelfths earn credit, a score of 7/117/117/11, just over one over the golden ratio. But twelve is an easy case. Every repeating tail there is a single digit, so a row either copies the reference forever or misses it in every place. Sevenths have tails six digits long, and elevenths come in five separate pairs. I expected the count to fall apart for them. It holds, and whether it holds comes down to one small question about long division, whether a digit can tell you which remainder wrote it.

Up to a point it always can, and the elevenths show what that looks like. Write the ten of them one under another and their repeating blocks run 09, 18, 27, 36 and on up to 90. That is the nine times table, the one where the tens digit climbs as the units digit falls. Read down any decimal place and every digit from 0 to 9 appears exactly once. The first column counts up, the second counts down, and then the pair starts over, for as many places as you care to carry the division.

All ten proper elevenths through four decimal places. Each column contains every decimal digit once. The ascending and descending columns repeat. All ten proper elevenths through four decimal places. Each column contains every decimal digit once. The ascending and descending columns repeat.
The ten elevenths, four places deep. Every column uses each digit once, climbing in gold and falling in teal.

Thirteen can’t manage it. It has twelve fractions and only ten digits to give them, so something has to double up, and it happens right away. The first digits of 1/131/131/13 through 12/1312/1312/13 are

0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9.0,\ 1,\ 2,\ 3,\ 3,\ 4,\ 5,\ 6,\ 6,\ 7,\ 8,\ 9.0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9.

Three and six each appear twice before the repeating blocks have even started.

A digit for each remainder

Long division keeps one number in its head, the remainder. Each step multiplies it by the base, writes the whole part of the quotient as the next digit, and carries what is left over to the next column. For a prime ppp in base bbb, remainder rrr writes the digit

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

The floor brackets keep the whole-number part. At eleven, remainder 4 gives 40=3⋅11+740=3\cdot11+740=3⋅11+7, so it writes a 3 and passes on 7. Then 70=6⋅11+470=6\cdot11+470=6⋅11+4 writes a 6 and passes back 4, and that is 4/11=0.3636…4/11=0.3636\ldots4/11=0.3636….

Group the remainders by the digit they write and you get what I call digit bins. The drawing puts the actual remainders in their bins.

Digit bins for primes 3, 7, 11, and 13 in base ten, labeled with their remainder states. At 13, states 4 and 5 share digit 3, and states 8 and 9 share digit 6. Digit bins for primes 3, 7, 11, and 13 in base ten, labeled with their remainder states. At 13, states 4 and 5 share digit 3, and states 8 and 9 share digit 6.
Remainders sorted by the digit they write. Eleven fills all ten bins once each. At thirteen two bins, in red, hold a pair.

At three and seven some bins sit empty. At eleven every bin holds exactly one remainder. At thirteen, 4 and 5 both write a 3, and 8 and 9 both write a 6.

The line between those cases is easy to find. When ppp is smaller than bbb, adding one to the remainder adds more than one to br/pbr/pbr/p, so the digit has to go up. Different remainders, different digits. At p=b+1p=b+1p=b+1 the digit is exactly one less than the remainder,

δ(r)=⌊r−rb+1⌋=r−1.\delta(r)=\left\lfloor r-\frac{r}{b+1}\right\rfloor=r-1.δ(r)=⌊r−b+1r​⌋=r−1.

which is the first column of the elevenths again. Past that point there are more nonzero remainders than digits, and two of them have to share. So among primes that don’t divide the base, every remainder gets its own digit exactly when

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

I call these primes digit-partitioning. In decimal there are three of them, 3, 7 and 11. Two and five divide ten, so their fractions terminate and never enter the count.

Separation at a single step is enough for the whole decimal. Multiplying by the base shuffles the nonzero remainders without ever merging two of them, so rows that start on different remainders stay on different remainders forever. If each remainder has its own digit, those rows never agree in a single column, however far the division runs.

Three different cycles

Inside that clean range the remainders can still move in very different ways. At three each remainder simply stays put, and the decimals are the familiar 0.333… and 0.666…. At seven all six remainders form a single loop, and the digits come out in the order

1→4→2→8→5→7→1.1\to4\to2\to8\to5\to7\to1.1→4→2→8→5→7→1.

The six sevenths are six starting points on that one loop, which is why their blocks are rotations of 142857 and why no column ever repeats a digit.

Eleven splits into five little loops of two. Ten is one less than eleven, so multiplying by ten flips a remainder to its complement, 11−r11-r11−r, and the next step flips it back. The digits pair off, 0 with 9 and 1 with 8 and so on, and every pair adds to nine.

Decimal remainder cycles labeled by the digits they emit. Three has fixed digits 3 and 6. Seven cycles through 142857. Eleven has five complement pairs, each summing to nine. Decimal remainder cycles labeled by the digits they emit. Three has fixed digits 3 and 6. Seven cycles through 142857. Eleven has five complement pairs, each summing to nine.
Remainders as dots labeled with the digit they write, arrows for one step of division. Three has two fixed points, seven one loop of six, eleven five loops of two. No digit appears twice in any of them.

Three pictures with almost nothing in common. What they share is the one thing the count needs. A digit always tells you which remainder wrote it.

The complete decimal tables

My pipes mark a repeating cycle carried until its digits add up to a multiple of nine. A third is written 0.|333|, three threes, while 1/7=0.∣142857∣1/7=0.|142857|1/7=0.∣142857∣ already has digits adding to 27.

Thirds

1/3 = 0.|333|
2/3 = 0.|666|

Sevenths

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

Elevenths

 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|

Thirteenths

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

Seven rows, three denominators

Now the count. At twelve, after two decimal places, three rows have terminated, four repeat the reference digit 3 and four repeat 6. A terminating row gets full credit by convention, and a repeating row gets the share of places where it matches the reference. That makes seven credits over eleven rows, 7/117/117/11.

Swap the three for a seven and keep the four. Denominator 28 has twenty-seven fractions to compare with 1/281/281/28. Three of them, 7/287/287/28, 14/2814/2814/28 and 21/2821/2821/28, terminate, and four more settle into exactly the reference’s tail.

 1/28 = 0.03|571428|
 8/28 = 0.28|571428|
15/28 = 0.53|571428|
22/28 = 0.78|571428|

The other twenty never match it in a single place. Some carry those six digits rotated, and that is enough to miss every column. We compare digits in the same column and never slide a row to improve its fit.

So it is still seven credited rows, now out of twenty-seven, and the score is 7/277/277/27. At 44 it is seven again, out of forty-three, with thirty-six rows missing everywhere. Eleven’s five separate loops don’t add a single extra term.

Exact aligned-row counts for denominators 12, 28, and 44 after two decimal places. Each has three terminating rows and four matching rows. The remaining row counts are 4, 20, and 36, giving scores 7/11, 7/27, and 7/43. Exact aligned-row counts for denominators 12, 28, and 44 after two decimal places. Each has three terminating rows and four matching rows. The remaining row counts are 4, 20, and 36, giving scores 7/11, 7/27, and 7/43.
The credited rows at 12, 28 and 44 on one scale. Three terminate and four match every time, while the rows that miss everywhere grow from four to thirty-six.
A one-column phase shift

The shared starting column is essential. In base two, the shortest repeating blocks of 1/61/61/6 and 1/31/31/3 are both “01”. But their prefixes have different lengths.

1/6 = 0.001010101…
1/3 = 0.010101010…
2/3 = 0.101010101…

Begin all three comparisons after the first binary digit. The tails of 1/61/61/6 and 2/32/32/3 agree, while the tail of 1/31/31/3 is out of phase. Restarting each fraction at the end of its own shortest prefix gives a different comparison.

Moving every row forward by the same number of additional places is harmless. It rotates both repeating words together and preserves their proportion of matching positions.

The count in general

The same thing happens for any denominator pmpmpm, where ppp is digit-partitioning and mmm is made only of primes that divide the base, twos and fives in decimal. Those are the factors long division clears in a few places. Start every comparison after the same number of places and every tail has denominator ppp, with each numerator’s class modulo ppp deciding where it enters the cycle.

Then the rows sort themselves into three groups. The m−1m-1m−1 multiples of ppp terminate. The mmm numerators one more than a multiple of ppp sit on the reference’s own remainder and match it everywhere. Every other numerator sits on a different remainder at every step, and since the prime is digit-partitioning, it writes a different digit at every step too.

Numerator class Rows Score per row
Multiples of ppp m−1m-1m−1 1 by the termination convention
One more than a multiple of ppp mmm 1 from complete agreement
All remaining classes (p−2)m(p-2)m(p−2)m 0 from complete disagreement

Average over all pm−1pm-1pm−1 proper fractions and the alignment 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​.

Neither the length of the cycle nor the number of cycles appears anywhere in that formula. There is nothing for them to add, since two different remainders never write the same digit.

The base decides which primes qualify and which factors mmm it can clear. After that the count is the same everywhere.

Base Digit-partitioning primes
6 5, 7
10 3, 7, 11
16 3, 5, 7, 11, 13, 17

At the endpoint p=b+1p=b+1p=b+1 the complement pairs come back too, adding to five in base six and fifteen in base sixteen, the way they add to nine in decimal.

Three keeps its place

With larger mmm the alignment rises toward 2/p2/p2/p, and the finite scores always stay below it. To beat one over the golden ratio, a digit-partitioning prime therefore needs

2p>1φ,p<2φ≈3.236,\frac{2}{p}>\frac{1}{\varphi}, \qquad p<2\varphi\approx3.236,p2​>φ1​,p<2φ≈3.236,

where φ=(1+5)/2\varphi=(1+\sqrt5)/2φ=(1+5​)/2.

Only three gets in, with a limit of two thirds. Seven tends to two sevenths and eleven to two elevenths, nowhere near. The bar chart showed the same thing from the other side. Hold mmm at four and the seven credited rows never change, while each bigger prime only adds rows that score nothing.

Three belongs to the class whenever it doesn’t divide the base, and drops out when it does. Odd bases also let in the prime two, whose alignment is always 1.

Repetends and related work

These decimals have a substantial history. Digit-Partitioning Primes and the Alignment Formula places its result alongside Armstrong and Armstrong’s work on repetends, Lewittes’s treatment of Midy’s theorem, Lempel and Greenberger’s Hamming-correlation framework, and Kak and Chatterjee’s work on decimal sequences.

The claim here joins the exact boundary p≤b+1p\leq b+1p≤b+1 to the count over every proper fraction with denominator pmpmpm. It does not require all the nonzero remainders to lie in a single cycle. The five separate pairs at eleven are included on the same terms as the full cycle at seven.

Two shared digits at thirteen

Thirteen is where all of this stops. Take two rows from its table.

113=0.076923‾,1113=0.846153‾.\frac{1}{13}=0.\overline{076923}, \qquad \frac{11}{13}=0.\overline{846153}.131​=0.076923,1311​=0.846153.

They write a 6 in the third place and a 3 in the sixth, so they agree in two places out of every six, a score of one third.

The six repeating digits of 1/13 and 11/13 agree in places three and six, giving score one third. Their remainder states before each digit remain different in all six places. The six repeating digits of 1/13 and 11/13 agree in places three and six, giving score one third. Their remainder states before each digit remain different in all six places.
1/13 and 11/13 with their remainders underneath. The digits agree twice, in gold, while the remainders never agree at all.

The two rows never share a remainder. In the third place the top row’s 6 comes from remainder 9 and the bottom row’s from remainder 8, two remainders that happen to share a bin. One step later they have moved on to 12 and 2, which write a 9 and a 1, and the rows part again. The match lasts exactly one column.

Bins and collisions through 499

This overview carries the remainder-to-digit assignment through 23. The first three primes have at most one remainder per occupied bin. Shared bins appear at 13 and become more numerous as the prime grows.

Original diagram of remainder assignments to decimal digit bins for primes 3, 7, 11, 13, 17, and 23.
Remainders on the left and digit bins on the right for each prime through 23. Shared bins, in red, first appear at 13, and by 23 every bin is shared.

The second drawing extends the comparison through 499. Its lower chart counts unordered pairs of distinct remainder states that produce the same digit. That total describes the bins as a whole. An alignment score against one chosen reference also depends on the bins visited by that reference’s repeating cycle.

Original digit-bin chart through prime 499, with a lower chart counting unordered pairs of states that emit the same digit.
Bin sizes for primes from 3 to 499, with the boundary between 11 and 13. The lower chart counts pairs of remainders sharing a bin, which grows roughly like the square of the prime.

That is the exact place the formula breaks. The terminating rows can still be counted, and so can the rows that copy the reference. What can’t be done any more is to give everything else a zero, because a row can now pick up a few matching digits without ever sharing a remainder. How many it picks up depends on two separate things. The bins decide which remainders write the same digit, and the floor function fixes those once and for all. The remainder cycles decide how often a given pair of rows lands in a shared bin at the same moment. Past b+1b+1b+1, that timing matters as much as the bins.

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 →