Digit-Partitioning Primes and the Alignment Formula
Abstract
For a prime p not dividing a positional base b, multiplication by b partitions the nonzero residues modulo p into cyclic orbits. Within each orbit, the corresponding fractions k/p carry cyclic shifts of one repeating block. We call p digit-partitioning when distinct nonzero remainder states always emit distinct digits. This happens exactly when p\le b+1.
Now let n=pm, where every prime factor of m divides b. We compare the periodic tails of all fractions k/n after one common depth that clears m. This synchronization is independent of the chosen depth. For every digit-partitioning prime, the resulting alignment is \alpha_b(pm) \;=\; \frac{2m - 1}{pm - 1}. In base ten this one formula covers single-digit repetends, a full cyclic orbit, and complement-pair partitions. The same injective digit map lies behind all three.
The Boundary of Digit Separation
In base ten, the ten fractions k/11, with 1\leq k\leq10, separate perfectly. At both positions of their repetends, the digits 0,\ldots,9 appear exactly once. The twelve fractions k/13, with 1\leq k\leq12, do not. Their leading digits repeat 3 and 6, since twelve nonzero remainder states must enter ten digit bins. The break is exact. For every prime p\nmid b, complete digit separation holds if and only if p\leq b+1.
This boundary is what makes the alignment count close. If n=pm and m is b-supported, then throughout the collision-free range \alpha_b(pm)=\frac{2m-1}{pm-1}. In base ten, this one count covers the single-digit repetends at p=3, the six cyclic shifts at p=7, and the five complement pairs at p=11. Three different mechanisms become one theorem.
Three and the Golden Ratio [1] begins with the three residue classes attached to n=3m. The question here is what those classes share with the cyclic orbit at p=7 and the complement pairs at p=11. The answer is not a particular repetend. It is an injective map from remainder states to digits. Locating its exact boundary shows where detailed orbit geometry can be ignored and where digit collisions begin to carry new information.
One step of long division has a remainder state and an emitted digit \delta(r)=\lfloor br/p\rfloor. Multiplication by b permutes the nonzero remainders, so injectivity at one position propagates through every position of the repetend. A local boundary for the floor map therefore controls the global alignment count.
The remainder clocks, digit bins, and alignment counts can be explored directly in nfield [5].
Combined with the threshold analysis in Three and the Golden Ratio [1], the formula leaves p=3 as the only possible prime p\ge3 above the golden threshold. This case is present whenever 3\nmid b.
Setting
Let b \ge 2 be a positional base and p a prime not dividing b. The multiplicative order L = \mathop{\mathrm{ord}}_p(b) is the length of the repetend of 1/p in base b [4]. The group (\mathbb{Z}/p\mathbb{Z})^{*} has order p - 1, and the cyclic subgroup \langle b \rangle has order L, partitioning \{1, \ldots, p-1\} into (p-1)/L cosets. Within each coset, the repetends of k/p are cyclic permutations of a common string.
Definition 1. A positive integer m is b-supported if every prime factor of m divides b. Equivalently, m divides some power of b.
Definition 2. For n = pm with m a b-supported integer, the repetend alignment \alpha_b(n) is defined at a common division depth. Choose t\ge0 with m\mid b^t. Beginning immediately after the first t base-b digits, compare the next L=\mathop{\mathrm{ord}}_p(b) digits of k/n with the corresponding digits of 1/n. For a terminating fraction, set a_b(k/n,1/n)=1. Otherwise, let a_b(k/n,1/n) be the fraction of the L synchronized positions at which the two digits agree. Then \alpha_b(n) is the mean of these scores over k \in \{1, \ldots, n-1\}.
After depth t, every nonterminating tail has reduced denominator p and period L. The definition does not depend on the choice of t. Replacing t by a larger clearing depth advances both nonterminating tails by the same power of b, so it rotates both length-L words together and leaves their position-wise match proportion unchanged.
Remark 3 (Why the tails are synchronized). We compare every fraction at the same long-division depth. We do not restart each fraction when its own shortest prefix ends. That phase reset defines a different statistic. The common-depth convention reads every floor evaluation at the same position. For example, in base 2, \frac16=0.0\overline{01}_2,\qquad \frac13=0.\overline{01}_2,\qquad \frac23=0.\overline{10}_2. Resetting the repeating blocks makes 1/6 match 1/3. Reading all three fractions after one common digit makes 1/6 match 2/3 instead.
The Digit Function
One step of long division turns a remainder into a digit and a new remainder. The next function records the digit.
Definition 4. For a prime p not dividing b, the digit function is \delta(r) \;=\; \left\lfloor \frac{br}{p} \right\rfloor, \qquad r \in \{0, 1, \ldots, p-1\}. The floor function partitions \{1, \ldots, p-1\} into contiguous bins of nearly equal size [2].
Lemma 5. If p \le b + 1, then \delta is injective on \{1, \ldots, p-1\}.
Proof. Two cases.
Case p = b + 1. For r \in \{1, \ldots, b\}, \delta(r) \;=\; \left\lfloor \frac{br}{b+1} \right\rfloor \;=\; \left\lfloor r - \frac{r}{b+1} \right\rfloor \;=\; r - 1, since 0 < r/(b+1) < 1 for 1 \le r \le b. The map r \mapsto r - 1 is a bijection from \{1, \ldots, b\} to \{0, \ldots, b-1\}.
Case p \le b. For distinct r, s \in \{1, \ldots, p-1\} with r<s, we have s-r\ge1. Coprimality rules out b=p, so p\le b actually gives b>p. Therefore \frac{bs}{p}-\frac{br}{p} =\frac{b(s-r)}p \ge\frac bp>1. The two quantities before flooring are separated by more than one, so their floors are strictly ordered. ◻
Remark 6. When p > b + 1, the function \delta maps p - 1 > b distinct remainders into b digit values. By the pigeonhole principle [3], \delta cannot be injective.
The Digit-Partitioning Property
Definition 7. A prime p is digit-partitioning in base b if, for every pair of distinct numerators k,\ell\in\{1,\ldots,p-1\}, the base-b expansions of k/p and \ell/p have different digits at every common position. Positions are phase-aligned from the radix point. A nontrivial cyclic rotation is therefore a different repetend phase, not an identical repetend.
Theorem 8. A prime p not dividing b is digit-partitioning in base b if and only if p \le b + 1.
Proof. At position j\in\{0,\ldots,L-1\} of the repetend of k/p, the digit is \delta(b^{j} k \bmod p). For distinct fractions k/p and \ell/p with k \not\equiv \ell \pmod p, the arguments b^{j} k and b^{j} \ell are distinct modulo p, since b^{j} is invertible.
If p \le b + 1, Lemma 5 makes \delta injective on \{1, \ldots, p-1\}, so distinct arguments produce distinct digits at every position. Hence p is digit-partitioning.
If p > b + 1, then \delta maps p - 1 > b remainders into b values, and the pigeonhole principle yields distinct r, s \in \{1, \ldots, p-1\} with \delta(r) = \delta(s). The first repetend digits of r/p and s/p agree. Thus p is not digit-partitioning. ◻
The Alignment Formula
Proposition 9. Let n = pm with m a b-supported integer and p \nmid b. The non-terminating fractions in \{k/n : 1 \le k \le n-1\} partition into (p-1)/L families of mL fractions each, where L = \mathop{\mathrm{ord}}_p(b). Every synchronized repetend has length L. Within each family the repetends are cyclic shifts of one another; repetends from different families are not cyclic shifts.
Proof. The nonzero multiples of p are p,2p,\ldots,(m-1)p. Their reduced denominators divide m, so they terminate. If p\nmid k, the reduced denominator still has the factor p and the expansion does not terminate. Thus there are m-1 terminating fractions and (p-1)m nonterminating ones.
Choose t with m \mid b^{t} and write b^{t} = mu, where \gcd(u, p) = 1 since m is b-supported and p \nmid b. Then \frac{k}{pm} \;=\; \frac{ku}{p \cdot b^{t}}. After the common clearing depth t, the periodic tail is generated by the nonzero residue ku\bmod p. Multiplication by u permutes the nonzero residues. Each nonzero residue class modulo p has exactly m representatives in \{1,\ldots,pm-1\}. Thus each fixed starting phase occurs exactly m times; a full orbit of L phases occurs mL times.
Starting from any nonzero residue r, the remainder returns to r after q digits exactly when b^qr\equiv r\pmod p. Since r is invertible, this is equivalent to b^q\equiv1\pmod p. A repeating block of length q represents a rational whose reduced denominator divides b^q-1. Since the tail has reduced denominator p, a shorter block would force p\mid b^q-1, and hence an earlier return. Every nonterminating tail therefore has least period L=\mathop{\mathrm{ord}}_p(b).
The residues 1, \ldots, p-1 partition into (p-1)/L cosets of \langle b \rangle in (\mathbb{Z}/p\mathbb{Z})^{*}. Residues in the same coset produce cyclic shifts of a single repetend; residues in different cosets produce distinct repetends, since their orbits under multiplication by b are disjoint. A coset has L residues, and every residue occurs m times. Hence each family has mL fractions. ◻
Theorem 10. If p\nmid b is prime, p \le b + 1, and m \ge 1 is b-supported, then \alpha_b(pm) \;=\; \frac{2m - 1}{pm - 1}.
Proof. Choose t with m\mid b^t and put u=b^t/m. At synchronized position j\in\{0,\ldots,L-1\}, the reference tail has remainder r_j\equiv b^ju\pmod p, while the tail of k/(pm) has remainder kr_j\pmod p. The remainder r_j is nonzero. Therefore the two remainders agree if and only if k\equiv1\pmod p.
If k\equiv1\pmod p, every synchronized digit agrees with the reference. If k\not\equiv0,1\pmod p, the two remainders are distinct at every synchronized position. Lemma 5 makes the digit function injective, so none of their digits agree, whether the two phases lie in different cosets or in the same one.
The count now splits into three cases.
The m - 1 terminating fractions (multiples of p). Each contributes alignment 1.
The m numerators 1,1+p,\ldots,1+(m-1)p, all congruent to 1 modulo p. Each contributes alignment 1.
The remaining (p-2)m non-terminating fractions. Each contributes alignment 0.
Thus exactly (m-1)+m=2m-1 of the pm-1 fractions are aligned. ◻
Corollary 11. For fixed digit-partitioning p, the alignment \alpha_b(pm) \to 2/p as m \to \infty through b-supported integers.
Enumeration
The digit-partitioning primes in base b are precisely the primes p \le b + 1 that do not divide b.
| Base b | Digit-part. primes | Alignment limits 2/p |
|---|---|---|
| 4 | 3, 5 | 0.667,\; 0.400 |
| 6 | 5, 7 | 0.400,\; 0.286 |
| 8 | 3, 5, 7 | 0.667,\; 0.400,\; 0.286 |
| 10 | 3, 7, 11 | 0.667,\; 0.286,\; 0.182 |
| 12 | 5, 7, 11, 13 | 0.400,\; 0.286,\; 0.182,\; 0.154 |
| 16 | 3, 5, 7, 11, 13, 17 | 0.667,\; \ldots,\; 0.118 |
The class of digit-partitioning primes grows with b, but the alignment formula (2m-1)/(pm-1) is uniform. It makes no reference to the base, to the order L, or to any of the mechanism-specific structure described below.
In base 10, the three digit-partitioning primes arise in structurally distinct ways. For p = 3, \mathop{\mathrm{ord}}_3(10) = 1, so repetends are single digits. For p = 7, \mathop{\mathrm{ord}}_7(10) = 6 = p-1, so 10 is a primitive root and the repetend is a cyclic number with all distinct digits. For p = 11, \mathop{\mathrm{ord}}_{11}(10) = 2 with 10 \equiv -1 \pmod{11}, so repetends form nines-complement pairs.
These three mechanisms are unified by the single condition p \le b+1 and the injectivity of \delta.
The Golden Threshold in the Digit-Partitioning Class
Corollary 11 gives the alignment limit \alpha_b(pm) \to 2/p for every digit-partitioning prime. The golden threshold 1/\varphi therefore selects, within this class, precisely those primes for which 2/p > 1/\varphi, i.e. p < 2\varphi \approx 3.236. Among primes p \ge 3, only p = 3 satisfies this. It belongs to the class whenever 3\nmid b; if 3\mid b, no admissible prime p\ge3 crosses the threshold. The prime 2 is the familiar degenerate exception when the base is odd.
Three and the Golden Ratio [1] gives the sharper threshold analysis and isolates p=3 through a self-referential cubic. The calculation here shows why its appearance is not peculiar to decimal notation. The same boundary p\le b+1 is present in every base.
Where Injectivity Ends
The boundary case
The case p = b + 1 is the tightest. The map \delta sends b remainders into exactly b digit values, so there is no room to spare. In base 10 this gives p = 11, whose five nines-complement pairs partition all ten digits exactly. The boundary case always produces the complement-pair structure, since b + 1 = p implies b \equiv -1 \pmod p.
Beyond the boundary
For p > b + 1, the digit function is no longer injective, so the zero-match argument in Theorem 10 breaks. The alignment then depends on the digit-bin multiplicities and on the coset visited by the synchronized tail. Determining that correction is the remaining problem.
References
[1]A. S. Petty, Three and the Golden Ratio, research note, January 2020 (revised August 2026). DOI: https://doi.org/10.5281/zenodo.20399951.
[2]A. S. Fraenkel, The bracket function and complementary sets of integers, Canad. J. Math. 21 (1969), 6–27.
[3]R. P. Stanley, Enumerative Combinatorics, vol. 1, 2nd ed., Cambridge University Press, 2012.
[4]G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 6th ed., Oxford University Press, 2008.
[5]A. S. Petty, nfield, software repository. https://github.com/alexspetty/nfield