The Alignment Deficit Lattice
Abstract
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 deficit ratio between two such integers satisfies \delta_p(m_1)/\delta_p(m_2) = (pm_2-1)/(pm_1-1) exactly. 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.
The prime-axis lattice description of just intonation is classical [3, 2, 1]. To the author’s knowledge, the specific alignment-deficit coordinate described here has not been previously noted.
Introduction and the Alignment Formula
The arithmetic of repeating decimals encodes structure that depends on the prime factorization of the base. When a fraction k/n is expanded in base b, the repetend length and digit pattern are governed by the multiplicative order of b modulo the prime factors of n. For primes p with b \equiv 1 \pmod{p}, the resulting one-digit repetends create a natural notion of alignment: 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^a 3^b\} underlying Pythagorean tuning arises from any base with prime support \{2,3\}; the lattice \{2^a 3^b 5^c\} underlying five-limit just intonation arises from base 30 = 2 \cdot 3 \cdot 5. The Pythagorean comma and the just major scale both appear as 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. For a positive integer n 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 base-b expansion of k/n either terminates (counted as aligned by convention, since the expansion eventually agrees with any reference) or has a repeating block that agrees position-by-position with that of 1/n.
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. Among the pm - 1 fractions k/(pm) with 1 \le k \le pm - 1:
The m - 1 multiples of p give terminating fractions, since all prime factors of m divide b.
Since \mathop{\mathrm{ord}}_p(b) = 1, each nonzero residue class modulo p produces a distinct one-digit repetend. The m integers k \equiv 1 \pmod p share the repetend 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.
Hence (m-1) + m = 2m - 1 fractions are aligned out of pm - 1. ◻
The P-supported integers form a free abelian monoid generated by the primes in P. This monoid is the positive octant of the prime-exponent lattice used in tuning theory since at least Euler [2, 1]. Musical intervals in the group completion \mathbb{Z}^k are recovered as ratios of two monoid points. The lattice \{2^a 3^b\} parametrizes Pythagorean intervals; the lattice \{2^a 3^b 5^c\} parametrizes five-limit just intonation [3, 2, 5, 6].
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.
The Deficit Map
Definition 5. For a prime p \ge 3 with p \nmid b and b \equiv 1 \pmod p, and a P-supported integer m \ge 1, the alignment deficit is \delta_p(m) \;=\; \frac{2}{p} - \alpha_b(pm).
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 and P-supported t \to \infty, \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). For a prime q \in P and any P-supported m, \frac{\delta_p(m)}{\delta_p(qm)} \;\longrightarrow\; q \quad\text{as } m \to \infty.
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.
Base 12 and the Pythagorean Comma
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) [1]. Its intervals are ratios of P-supported integers in the group completion \mathbb{Z}^2. The deficit lattice and the Pythagorean lattice share the same generators.
Proposition 9 (Pythagorean comma). Fix p = 11 and P-supported integers u = 3^{12}, v = 2^{19}. For any P-supported t, \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. Setting u = 3^{12}, v = 2^{19} in Theorem 7 gives the asymptotic v/u = 2^{19}/3^{12}. Inverting: \delta_{11}(t \cdot 2^{19})/\delta_{11}(t \cdot 3^{12}) \to 3^{12}/2^{19}. At t = 1: (11 \cdot 3^{12} - 1)/(11 \cdot 2^{19} - 1) = 5845850/5767167 \approx 1.013643. ◻
Remark 10 (Base dependence). The lattice structure depends on P, not on b itself. Any base with P = \{2, 3\} (such as 6, 12, 24) produces the Pythagorean lattice. For base 10 = 2 \cdot 5, the prime 3 is not in P: the deficit lattice carries octaves and major thirds (5/4) but not fifths (3/2). The Pythagorean comma requires both 2 and 3 and cannot appear.
Base 30 and the Just Major Scale
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, 2].
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 [1, 4].
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. For any P-supported scaling factor t, \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 by factorization: 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 24 are as stated. The asymptotic follows from Theorem 7. ◻
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 step pattern between consecutive diatonic notes is 9/8, 10/9, 16/15, 9/8, 10/9, 9/8, 16/15: the classical whole-tone/semitone pattern [2].
Remark 13. At m_0 = 480, the standard five-limit just chromatic scale [1] (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 \times 10^{-5}.
Remarks
Novelty and scope
The prime-exponent lattice description of just intonation is classical, going back at least to Euler [2, 1]. The identification of smooth numbers with musical intervals has been noted in the recent literature [5, 6]. To the author’s knowledge, the specific alignment-deficit coordinate described here has not been previously noted. The musical content of the observation depends on the prime support of the base, not the base itself. 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.
References
[1]J. M. Barbour, Tuning and Temperament: A Historical Survey, Michigan State College Press, 1951. Reprinted by Dover, 2004.
[2]D. J. Benson, Music: A Mathematical Offering, Cambridge University Press, 2007.
[3]H. von Helmholtz, On the Sensations of Tone, 1863. English translation by A. J. Ellis, Dover, 1954.
[4]R. C. Archibald, Mathematicians and music, Amer. Math. Monthly 31 (1924), 1–25.
[5]F. Jevtić, Smooth numbers in music and architecture, in A Hidden Harmony: Mathematics and Music Through the Ages, Zbornik radova, Matematički institut SANU, 2024. doi:10.18485/mi_sanu_zr.2024.29.21.ch4.
[6]E. Kurenniemi, Chords, scales, and divisor lattices, in Writing and Unwriting (Media) Art History: Erkki Kurenniemi in 2048, MIT Press, 2014. doi:10.7551/mitpress/10014.003.0026.