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

Primes and the Major Scale

October 31, 202012 min read
Companion paper: The Alignment Deficit Lattice and Musical Tuning →
Gold points rise across a large lattice among blue and white points, with a smaller gold lattice at the lower right.
Changing the base changes the available prime directions. The deficit ratios approach the musical intervals those primes allow.

I have been a musician for most of my life. I have also spent most of my life hearing people claim that the golden ratio explains music. These claims always dissolve on contact with the mathematics. The golden ratio is not the frequency ratio of any interval in any standard tuning system. The Fibonacci sequence approximates the semitone layout but does not generate it. The popular accounts do not produce the scale.

The calculation here begins with repeating decimals. Count the fractions that terminate or eventually share the repeating tail of a reference fraction. Then look at the distance between that proportion and its limit. Ratios of those remaining distances approach the intervals of musical tuning.

The primes available in the base determine which intervals we can reach. In base 10, something familiar is missing. Changing the base lets us recover it.

The deficit

Take the decimal fractions k/(3m)k/(3m)k/(3m), where mmm is built entirely from the primes 2 and 5. Their alignment is (2m−1)/(3m−1)(2m-1)/(3m-1)(2m−1)/(3m−1). This is the formula behind the middle band in The Three-Tier Theorem. It approaches 2/32/32/3 but never reaches it. The distance still to go is the deficit.

δ3(m)=23−α10(3m)=13(3m−1)\delta_3(m) = \frac{2}{3} - \alpha_{10}(3m) = \frac{1}{3(3m-1)}δ3​(m)=32​−α10​(3m)=3(3m−1)1​

Look at the deficits for the pure powers of 2.

mmm n=3mn = 3mn=3m Deficit
4 12 1/33
8 24 1/69
16 48 1/141
32 96 1/285
64 192 1/573

Each step doubles mmm and approximately halves the deficit. The first pair gives a ratio of 69/3369/3369/33, a little more than 2. The next gives 141/69141/69141/69, closer to 2. The difference keeps shrinking.

In music, each octave doubles the frequency.

That parallel has an exact formula behind it. In a base bbb, choose a prime p≥3p\geq3p≥3 dividing b−1b-1b−1, and let mmm use only prime factors of the base. This gives the same one-digit repeating-tail count. Its deficit from 2/p2/p2/p is

δp(m)=p−2p(pm−1).\delta_p(m)=\frac{p-2}{p(pm-1)}.δp​(m)=p(pm−1)p−2​.

Divide the deficit at one point by the deficit at another. The constant cancels.

δp(m1)δp(m2)=pm2−1pm1−1.\frac{\delta_p(m_1)}{\delta_p(m_2)}=\frac{pm_2-1}{pm_1-1}.δp​(m2​)δp​(m1​)​=pm1​−1pm2​−1​.

This is the exact finite ratio. To see its limit, keep two starting points uuu and vvv fixed and multiply both by the same growing factor ttt, also built from the base’s primes.

δp(tu)δp(tv)=ptv−1ptu−1⟶vu.\frac{\delta_p(tu)}{\delta_p(tv)}=\frac{ptv-1}{ptu-1}\longrightarrow\frac{v}{u}.δp​(tv)δp​(tu)​=ptu−1ptv−1​⟶uv​.

The deficit runs in the opposite direction from mmm. Larger integers leave smaller deficits. Taking the smaller integer’s deficit over the larger integer’s deficit recovers their interval ratio in the limit.

In base 10, the available integers are 2a5c2^a5^c2a5c, with nonnegative exponents. Picture a grid with a 2-axis and a 5-axis. A step along either axis multiplies the integer by that prime. Ratios between grid points give octaves and the just major third, 5/45/45/4.

But no combination of multiplying and dividing by 2 and 5 gives 3/23/23/2. The prime 3 appears in the denominator 3m3m3m, yet it is absent from the allowed factors of mmm. Those are different roles.

The fifth is missing.

Base 10 can reach the major third through 50/40. The fifth would need 60/40, and 60 has the forbidden factor 3. The other rows show how changing the base changes the available intervals.
Base 10 can reach the major third through 50/40. The fifth would need 60/40, and 60 has the forbidden factor 3. The other rows show how changing the base changes the available intervals.

Base 12

Change the base and the lattice changes with it.

Base 12 has prime factors 2 and 3. Use p=11p=11p=11, since 11 divides 12−112-112−1. The denominator is now 11m11m11m, and mmm can move along a 2-axis and a 3-axis.

The octave is a ratio of 2. The twelfth, an octave plus a fifth, is a ratio of 3. Every Pythagorean interval is a ratio of products of these two primes. The fifth, 3/23/23/2, is one step along the 3-axis and one step back along the 2-axis. The fourth, 4/34/34/3, is two steps along the 2-axis and one step back along the 3-axis.

The integers occupy the part of the grid with nonnegative exponents. Taking ratios between them allows steps in either direction. This is the familiar prime-exponent lattice of Pythagorean tuning, now carrying a deficit value at each integer point.

The finite deficit ratios approach its musical intervals as both points grow together.

The comma

Start on a note and ascend twelve perfect fifths. Start again and ascend seven octaves. The two routes almost meet.

Twelve fifths multiply the frequency by (3/2)12(3/2)^{12}(3/2)12. Seven octaves multiply it by 272^727. Divide one by the other.

(3/2)1227=312219=531441524288≈1.01364.\frac{(3/2)^{12}}{2^7}=\frac{3^{12}}{2^{19}}=\frac{531441}{524288}\approx1.01364.27(3/2)12​=219312​=524288531441​≈1.01364.

This is the Pythagorean comma, about a quarter of a semitone. Pure fifths do not close into an exact circle. In twelve-tone equal temperament, each fifth is narrowed by one twelfth of the comma, measured logarithmically, so that twelve of them reach seven octaves. Benson’s account follows the arithmetic of that mismatch.

Now take the two integers left by the calculation, 531441 and 524288, as points in the base 12 deficit lattice. The exact formula gives

δ11(524288)δ11(531441)=58458505767167≈1.013643.\frac{\delta_{11}(524288)}{\delta_{11}(531441)}=\frac{5845850}{5767167}\approx1.013643.δ11​(531441)δ11​(524288)​=57671675845850​≈1.013643.

The Pythagorean comma. Matching to six significant figures at these finite points. Exact in the limit as both points are scaled together.

The two routes miss by about 23.46 cents. One equal-tempered semitone is 100 cents. The deficit ratio approaches the classical comma as the integer points grow.
The two routes miss by about 23.46 cents. One equal-tempered semitone is 100 cents. The deficit ratio approaches the classical comma as the integer points grow.

An old tension in musical tuning reappears in a theorem about repeating decimals. The ratio formula tells us why, and also how much difference remains at every finite scale.

Base 10 cannot recover the comma as a ratio in its prime-exponent lattice. Like the fifth, it requires the missing prime 3.

Base 30 and the major scale

Base 30=2×3×530=2\times3\times530=2×3×5 adds the third axis.

These are the three primes of five-limit just intonation. The octave is 2, the fifth is 3/23/23/2, and the major third is 5/45/45/4. Choose p=29p=29p=29, and the alignment deficits live on the same integer grid.

Start at m0=24=23×3m_0=24=2^3\times3m0​=24=23×3. The classical just major scale has ratios 111, 9/89/89/8, 5/45/45/4, 4/34/34/3, 3/23/23/2, 5/35/35/3, 15/815/815/8, and 222. Their least common denominator is 24. Multiplying by 24 gives eight integers, each built from the primes 2, 3 and 5.

Note mmm Interval m/24m/24m/24 Finite deficit ratio
Do 24 1 1.000
Re 27 9/8 1.125
Mi 30 5/4 1.250
Fa 32 4/3 1.334
Sol 36 3/2 1.501
La 40 5/3 1.668
Ti 45 15/8 1.876
Do 48 2 2.001

The last column is δ29(24)/δ29(m)=(29m−1)/695\delta_{29}(24)/\delta_{29}(m)=(29m-1)/695δ29​(24)/δ29​(m)=(29m−1)/695, rounded to three decimal places. The largest relative difference from a just interval is less than 0.072 percent. The octave is a little wide. So is the fifth.

There are other lattice points in this octave. The integer 25=5225=5^225=52 lies between 24 and 27 and gives the interval 25/2425/2425/24. The eight notes above are the familiar diatonic selection from a larger collection. The lattice contains the scale. It does not choose those eight notes for us.

Watch the fifth lock in as the starting point grows.

m0m_0m0​ Deficit ratio at 3m0/23m_0/23m0​/2
24 1.500719
240 1.500072
2400 1.500007
24000 1.5000007
240000 1.50000007
2400000 1.500000007

Each row gains roughly a decimal place. The limiting ratio is exactly 3/23/23/2. Every interval in the scale table has the corresponding limit.

At the scale of an octave, these small differences almost disappear on a plot. The figure below measures the remaining relative error in parts per million. Following a note from gold to blue to white shows the convergence.

Following Sol down the three curves shows the fifth settling toward 3/2. The other intervals do the same. The initial Do is exact because a deficit divided by itself is one.
Following Sol down the three curves shows the fifth settling toward 3/2. The other intervals do the same. The initial Do is exact because a deficit divided by itself is one.

The step ratios between consecutive notes tend to 9/89/89/8, 10/910/910/9, 16/1516/1516/15, 9/89/89/8, 10/910/910/9, 9/89/89/8, and 16/1516/1516/15. Just intonation has two sizes of whole tone here. The familiar pattern is still

Whole tone. Whole tone. Semitone. Whole tone. Whole tone. Whole tone. Semitone.

The intervals the base allows

The prime support determines the grid and its limiting interval ratios. Bases 6, 12 and 24 all have prime support {2,3}\{2,3\}{2,3}, so all three give the Pythagorean lattice. Bases 30, 60 and 120 have prime support {2,3,5}\{2,3,5\}{2,3,5} and give the five-limit lattice. The finite deficit values also depend on the chosen prime ppp dividing b−1b-1b−1.

Add 7 by moving to base 210=2×3×5×7210=2\times3\times5\times7210=2×3×5×7. The lattice gains another axis. With p=11p=11p=11, deficit ratios at the points 4t4t4t and 7t7t7t approach the harmonic seventh, 7/47/47/4. Those at 7t7t7t and 8t8t8t approach the septimal whole tone, 8/78/78/7. The same ratio theorem applies.

The new base retains the five-limit intervals and admits more. We can read that extension directly from its factorization.

The route through long division

The musical lattice is established mathematics. Its history reaches back to Euler. Helmholtz developed the account of consonance and frequency ratios in On the Sensations of Tone. Barbour’s Tuning and Temperament traces the history of tuning systems. Benson’s account of music and mathematics and Kurenniemi’s Chords, Scales, and Divisor Lattices describe the prime-based structure. Archibald’s 1924 survey already gives the just major scale as the integer sequence 24, 27, 30, 32, 36, 40, 45, 48.

To my knowledge, the specific alignment-deficit coordinate described here has not been previously noted. Its contribution is the route from long division to that established lattice, with an exact ratio formula at every finite point.

Any positive function behaving like a constant divided by mmm would recover the same limiting ratios on these integers. Convergence alone does not distinguish the deficit. What interests me is that this function comes from counting repeating tails. We can derive it from the digit function, compare two finite values exactly, and follow the remaining difference all the way to a familiar musical interval.

I began with fractions sharing a denominator. Counting their agreement left a small distance from a limit. Comparing those distances brought me to the octave, the fifth, the comma, and the just major scale. The intervals were already known. The arithmetic of long division supplied the coordinate.

A road nobody took to a place that was already on the map.

Companion paper: The Alignment Deficit Lattice and Musical Tuning →
Share

Comments

Sign in to join the discussion.

← Previous: The Three-Tier Theorem
Next: The Coherence Decomposition →