For a prime p \ge 3 with b \equiv 1 \pmod p and an integer m whose prime factors all divide b, the repetend alignment \alpha_b(pm) = (2m-1)/(pm-1) approaches 2/p with deficit \delta_p(m) \;=\; \frac{p-2}{p(pm-1)}. The exact deficit ratio between two such integers is \frac{\delta_p(m_1)}{\delta_p(m_2)} =\frac{pm_2-1}{pm_1-1}. Writing m_1 = tu, m_2 = tv for fixed u, v and scaling t \to \infty through P-supported integers, the ratio converges to v/u.
The integers supported on a fixed set of primes P = \{q \text{ prime} : q \mid b\} form a free abelian monoid, and the deficit map is an injective, order-reversing numerical coordinate on this monoid. When P coincides with the generators of a musical tuning system, the deficit ratios recover the intervals of that system asymptotically.
Representing just intervals by prime-exponent vectors is standard [3, 7]. To the author’s knowledge, the specific alignment-deficit coordinate described here has not been previously noted.
The arithmetic of repeating decimals encodes structure that depends on the prime factorization of the base. In the base-b expansion of a rational number, factors shared with b govern the terminating part, while the periodic part is governed by multiplication by b modulo the remaining denominator. For primes p with b \equiv 1\pmod p, the resulting one-digit repetends create a natural notion of alignment. This is the fraction of numerators k whose base-b expansion shares its repeating pattern with 1/n.
This paper establishes an exact formula for the alignment of fractions k/(pm) when m is supported on the prime factors of b, and studies the resulting deficit from the limiting alignment 2/p. The deficit has an exact ratio formula at every finite m, and the ratio of deficits at two points m_1, m_2 converges to m_2/m_1 as both scale to infinity. This makes the deficit a numerical coordinate on the monoid of b-supported integers whose ratios recover the multiplicative structure of the monoid.
When the prime support of the base coincides with the generators of a musical tuning system, this convergence recovers the intervals of that system. The lattice \{2^{e_2}3^{e_3}:e_2,e_3\in\mathbb{Z}\} underlying Pythagorean tuning arises from any base with prime support \{2,3\}; adjoining the 5-axis gives the five-limit lattice, as in base 30=2\cdot3\cdot5. The Pythagorean comma and the just major scale are recovered as limits of exact deficit ratios, with relative errors below 10^{-3} even at the smallest scale.
We proceed as follows. The remainder of this section establishes the alignment formula and its setting. Section 2 develops the deficit map and its ratio properties. Sections 3 and 4 apply the theory to base 12 (Pythagorean tuning) and base 30 (five-limit just intonation), recovering the Pythagorean comma and the just major scale from the arithmetic of repeating decimals.
Definition 1. An integer m \ge 1 is P-supported if every prime factor of m belongs to P = \{q \text{ prime} : q \mid b\}. Equivalently, m divides some power of b.
Remark 2. In standard number theory, “B-smooth” means all prime factors are \le B. Our condition is different. We require all prime factors to divide b, not merely to be bounded by b. We use “P-supported” to avoid confusion.
Definition 3. Use the standard base-b expansion, with terminating expansions written with an eventual tail of zeros rather than an infinite tail of digits b-1. For an integer n\ge2 and a base b \ge 2, the repetend alignment \alpha_b(n) is the fraction of k \in \{1, \ldots, n-1\} for which the expansion of k/n either terminates (counted as aligned by convention) or is identical, digit for digit, to the expansion of 1/n at every sufficiently large common position.
Theorem 4 (Repetend alignment theorem). Let p \ge 3 be a prime with \mathop{\mathrm{ord}}_p(b) = 1 (equivalently, b \equiv 1 \pmod p), and let m be P-supported. Then \alpha_b(pm) \;=\; \frac{2m-1}{pm-1}.
Proof. Write b=hp+1, where h=(b-1)/p. For each r\in\{1,\ldots,p-1\}, one step of base-b long division gives br=(hr)p+r. Thus the quotient digit is d_r=hr and the remainder is again r. Since 0<d_r<b, this is a valid base-b digit, and hence \frac{r}{p}=0.\overline{d_r}_b. Distinct nonzero residues r therefore give distinct one-digit repetends.
Choose L so that m\mid b^L, and put c=b^L/m. Shifting the base-b point by L places gives b^L\frac{k}{pm}=\frac{ck}{p}. Also p\nmid b. Both m and c divide powers of b, so p\nmid mc and c is invertible modulo p. The fractional part of ck/p is (ck\bmod p)/p. By the preceding long-division calculation, the eventual digit of k/(pm) is determined by ck\bmod p, while that of 1/(pm) is determined by c\bmod p. The two nonterminating tails agree digit for digit exactly when ck\equiv c\pmod p, or, since c is invertible, when k\equiv1\pmod p.
We can now count the pm-1 numerators 1\le k\le pm-1.
Exactly m-1 numerators, namely p,2p,\ldots,(m-1)p, are nonzero multiples of p. For these, k/(pm) reduces to a fraction whose denominator is P-supported, so its base-b expansion terminates. Conversely, if p\nmid k, the reduced denominator retains the factor p and the expansion does not terminate.
Exactly m numerators, namely 1,1+p,\ldots,1+(m-1)p, satisfy k\equiv1\pmod p. They are nonterminating and, by the preceding residue calculation, share the repeating block of 1/(pm).
The remaining (p-2)m fractions fall into p-2 residue classes modulo p, each with a one-digit repetend different from that of 1/(pm), so none of them are aligned.
The terminating and matching-repetend classes are disjoint. Hence (m-1)+m=2m-1 fractions are aligned out of pm-1, which gives the stated formula. ◻
Example. In base 12, take p=11 and m=2, so pm=22. Among k=1,\ldots,21, the numerator k=11 gives the terminating fraction 11/22=1/2. The two numerators k=1,12 satisfy k\equiv1\pmod{11}, so their repetends match that of 1/22. Thus 1+2=3 numerators are aligned, in agreement with \alpha_{12}(22)=\frac{2\cdot2-1}{11\cdot2-1}=\frac{3}{21}.
The P-supported integers form the free abelian monoid on P. Writing P=\{q_1,\ldots,q_s\}, the exponent map m=\prod_{i=1}^s q_i^{e_i}\longmapsto(e_1,\ldots,e_s) identifies this monoid with \mathbb{N}_0^s, the nonnegative orthant in the prime-exponent lattice \mathbb{Z}^s. Its group completion represents P-supported rational intervals [3, 7]. Allowing integer exponents, \{2^{e_2}3^{e_3}\} parametrizes Pythagorean intervals, while \{2^{e_2}3^{e_3}5^{e_5}\} parametrizes five-limit just intonation [3, 4].
This note observes that the alignment deficit provides a specific numerical coordinate on this monoid, arising from the digit function d_b(r) = \lfloor br/p \rfloor of long division, whose ratios recover the tuning intervals asymptotically.
Definition 5. Fix a base b\ge2, write P=P_b=\{q\text{ prime}:q\mid b\}, and let p\ge3 be a prime divisor of b-1. For a P_b-supported integer m\ge1, the alignment deficit is \delta_{b,p}(m) \;=\; \frac{2}{p} - \alpha_b(pm). When the base is fixed, as it is in each application below, we abbreviate \delta_{b,p}(m) to \delta_p(m).
Remark 6. By direct computation, \delta_p(m) = \frac{2(pm-1) - p(2m-1)}{p(pm-1)} = \frac{p - 2}{p(pm-1)}.
Theorem 7 (Deficit ratio theorem). For P-supported integers m_1, m_2 \ge 1, \frac{\delta_p(m_1)}{\delta_p(m_2)} \;=\; \frac{pm_2 - 1}{pm_1 - 1}. The constant (p-2) cancels. For fixed P-supported u,v, as t tends to infinity through P-supported positive integers, \frac{\delta_p(tu)}{\delta_p(tv)} \;=\; \frac{ptv - 1}{ptu - 1} \;\longrightarrow\; \frac{v}{u}.
Proof. The ratio is (pm_2 - 1)/(pm_1 - 1) by direct computation. For the asymptotic, (ptv - 1)/(ptu - 1) = (v/u) \cdot (1 - 1/(ptv))/(1 - 1/(ptu)) \to v/u as t \to \infty. ◻
Corollary 8 (Generator scaling). Fix a prime q\in P. As m tends to infinity through P-supported positive integers, \frac{\delta_p(m)}{\delta_p(qm)} =\frac{pqm-1}{pm-1} =q+\frac{q-1}{pm-1} \;\longrightarrow\; q.
The deficit map \delta_p is injective and order-reversing on the P-supported integers (larger m gives smaller deficit). It provides a numerical coordinate whose ratios asymptotically reproduce the multiplicative structure of the monoid.
For base 12 = 2^2 \cdot 3, we have P = \{2, 3\}. The condition b \equiv 1 \pmod p gives p = 11.
Pythagorean tuning is generated by the octave (2{:}1) and the perfect fifth (3{:}2) [2]. Its intervals are ratios of P-supported integers in the group completion \mathbb{Z}^2. The domain of the alignment-deficit coordinate is therefore the nonnegative cone in the same prime-exponent lattice.
Proposition 9 (Pythagorean comma). As t tends to infinity through P-supported positive integers, \frac{\delta_{11}(t \cdot 2^{19})}{\delta_{11}(t \cdot 3^{12})} \;\longrightarrow\; \frac{3^{12}}{2^{19}} \;\approx\; 1.01364 \quad (t \to \infty). The limit is the Pythagorean comma. At t = 1, the ratio is 1.013643, matching the comma to six significant figures.
Proof. Apply Theorem 7 with m_1=t\cdot2^{19} and m_2=t\cdot3^{12}. This gives \delta_{11}(t \cdot 2^{19})/\delta_{11}(t \cdot 3^{12}) \to 3^{12}/2^{19}. At t = 1, the exact value is (11 \cdot 3^{12} - 1)/(11 \cdot 2^{19} - 1) = 5845850/5767167 \approx 1.013643. ◻
Remark 10 (Base dependence). The prime-exponent domain and the limiting interval ratios depend only on P. The finite deficit values and their approximation errors also depend on the chosen alignment prime p. Any base with P=\{2,3\}, such as 6, 12, or 24, has the Pythagorean prime-exponent domain. For base 10=2\cdot5, the prime 3 is absent, so the domain contains octaves and major thirds (5/4) but not fifths (3/2). The Pythagorean comma requires both 2 and 3 and cannot appear.
For base 30 = 2 \cdot 3 \cdot 5, we have P = \{2, 3, 5\} and p = 29. The P-supported monoid shares its generators with five-limit just intonation [3, 4].
The just major scale uses the interval ratios 1, 9/8, 5/4, 4/3, 3/2, 5/3, 15/8, 2, a classical set [2, 5].
Proposition 11 (Diatonic lattice). Let m_0 = 24 = 2^3 \cdot 3. The eight P-supported integers 24,\; 27,\; 30,\; 32,\; 36,\; 40,\; 45,\; 48 have ratios to m_0 equal to the just major scale intervals. As the P-supported scaling factor t tends to infinity, \frac{\delta_{29}(t \cdot 24)}{\delta_{29}(t \cdot m)} \;\longrightarrow\; \frac{m}{24} \quad (t \to \infty) for each m in the list. At t = 1 the relative errors are below 7.2 \times 10^{-4}.
Proof. Each integer is P-supported, as shown by its factorization. 24 = 2^3 \cdot 3, 27 = 3^3, 30 = 2 \cdot 3 \cdot 5, 32 = 2^5, 36 = 2^2 \cdot 3^2, 40 = 2^3 \cdot 5, 45 = 3^2 \cdot 5, 48 = 2^4 \cdot 3. The ratios to m_0 = 24 are \begin{gathered} \frac{27}{24} = \frac{9}{8},\quad \frac{30}{24} = \frac{5}{4},\quad \frac{32}{24} = \frac{4}{3},\quad \frac{36}{24} = \frac{3}{2},\\ \frac{40}{24} = \frac{5}{3},\quad \frac{45}{24} = \frac{15}{8},\quad \frac{48}{24} = 2. \end{gathered} These are the classical just major scale intervals. By Theorem 7 with m_1 = t \cdot 24 and m_2 = t \cdot m, \frac{\delta_{29}(t \cdot 24)}{\delta_{29}(t \cdot m)} = \frac{29\,tm - 1}{29 \cdot 24\,t - 1} = \frac{m}{24}\cdot \frac{1 - 1/(29\,tm)}{1 - 1/(696\,t)} \longrightarrow \frac{m}{24} \quad(t \to \infty). At t=1, the relative error at the scale point m is exactly \frac{(29m-1)/(29\cdot24-1)}{m/24}-1 =\frac{m-24}{695m}. This expression increases with m on the listed range. Its maximum occurs at m=48 and equals 24/(695\cdot48)=1/1390<7.2\times10^{-4}. ◻
Remark 12. The choice m_0 = 24 is the least common denominator of the just major scale ratios. The resulting integers are P-supported because the scale ratios involve only the primes 2, 3, 5. Any base with prime support containing \{2, 3, 5\} produces a P-supported lattice that contains the same five-limit sublattice (a base with prime support \{2, 3, 5, 7\} gives a larger lattice).
The P-supported integers in [24, 48] also include 25 = 5^2, giving the ratio 25/24 (just chromatic semitone). The diatonic scale is a subset of the full lattice within this octave, not the complete set.
The successive step ratios between diatonic notes are 9/8, 10/9, 16/15, 9/8, 10/9, 9/8, and 16/15. This is the classical whole-tone/semitone pattern [3].
Remark 13 (A seven-limit extension). Seven-limit just intonation uses the prime set \{2,3,5,7\} and includes the harmonic seventh 7/4 and the septimal whole tone 8/7 [3]. For b=210, P_b=\{2,3,5,7\} and 11\mid210-1, so Theorem 7 applies with p=11. As t tends to infinity through P_b-supported positive integers, \frac{\delta_{210,11}(4t)}{\delta_{210,11}(7t)} =\frac{77t-1}{44t-1}\longrightarrow\frac74, \qquad \frac{\delta_{210,11}(7t)}{\delta_{210,11}(8t)} =\frac{88t-1}{77t-1}\longrightarrow\frac87.
Remark 14. At m_0=480, a common five-limit just chromatic scale [2] (with ratios 1, 16/15, 9/8, 6/5, 5/4, 4/3, 45/32, 3/2, 8/5, 5/3, 9/5, 15/8, 2) produces thirteen P-supported integers. The deficit ratios have relative errors below 3.6\times10^{-5}. Indeed, the same calculation as above gives the maximum at m=960, where the relative error is 1/27838<3.6\times10^{-5}.
Borel’s notion of normality and repetend alignment both concern digit blocks in a fixed base, but they quantify different objects. A real number is normal to base b if every k-digit block has limiting frequency b^{-k} in its canonical infinite digit expansion [1]. The canonical base-b expansion of a rational number is eventually periodic and therefore non-normal. Indeed, if its periodic tail has period L, then for any k with b^k>L, at most L of the b^k possible k-blocks can have positive limiting frequency.
By contrast, \alpha_b(pm) counts, across the finite family k/(pm), the expansions that terminate or share the specified periodic tail of 1/(pm). Thus \delta_p(m) measures the difference between this finite-family proportion and 2/p, not a distance from normality.
The prime-exponent representation of just intonation is standard [3, 7], and the relation between smooth numbers and musical intervals has been discussed in the literature [6, 7]. To the author’s knowledge, the specific alignment-deficit coordinate described here has not been previously noted. The musical content and the limiting ratios depend on the prime support of the base; the finite coordinate values also depend on the alignment prime. Many functions f(m) \sim C/m on the P-supported monoid share this asymptotic behavior. The contribution here is that the arithmetic of repeating decimals produces such a function naturally, with an elementary derivation and an exact (not merely asymptotic) ratio formula at every finite m.
[1]É. Borel, Les probabilités dénombrables et leurs applications arithmétiques, Rend. Circ. Mat. Palermo 27 (1909), 247–271. doi:10.1007/BF03019651.
[2]J. M. Barbour, Tuning and Temperament: A Historical Survey, Michigan State College Press, 1951. Reprinted by Dover, 2004.
[3]D. J. Benson, Music: A Mathematical Offering, Cambridge University Press, 2007.
[4]H. von Helmholtz, On the Sensations of Tone as a Physiological Basis for the Theory of Music, 2nd English ed., translated by A. J. Ellis, Longmans, Green, 1885; reprinted by Dover, 1954.
[5]R. C. Archibald, Mathematicians and music, Amer. Math. Monthly 31 (1924), 1–25.
[6]F. D. Jevtić, Smooth numbers in music and architecture, in V. Todorčević (ed.), A Hidden Harmony: Mathematics and Music Through the Ages, Zbornik radova / Matematički institut SANU, 29(21) (2024), 69–74. doi:10.18485/mi_sanu_zr.2024.29.21.ch4.
[7]E. Kurenniemi, Chords, scales, and divisor lattices (2003), in J. Krysa and J. Parikka (eds.), Writing and Unwriting (Media) Art History: Erkki Kurenniemi in 2048, MIT Press, 2015, 233–254. doi:10.7551/mitpress/10014.003.0026.
Discussion
Sign in to join the discussion.