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

Primes and the Major Scale

October 31, 202015 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 that the golden ratio explains music. The explanations I encountered failed on contact with the mathematics, but I kept looking. After years of working on the question, I found a connection through repeating decimals. I call it the alignment-deficit lattice.

The route runs through repeating decimals and the primes in the base. For certain denominators, the proportion of aligned fractions approaches a limit. The distance left over is a small, exact fraction. Compare two of those distances and familiar musical ratios begin to appear.

Decimal gives us the octave and the just major third, but it leaves out the perfect fifth. To reach that interval, we need a base with a factor of 3.

The deficit below two thirds

Among the eleven proper twelfths, four fractions eventually share the repeating tail of 1/121/121/12. Three others terminate and receive a whole credit under the alignment convention. That gives seven credits among eleven fractions, or an alignment of 7/117/117/11.

This is one of the counts behind the middle band of decimal alignment. For a denominator 3m3m3m, where mmm is built entirely from 2 and 5, the formula is

α10(3m)=2m−13m−1.\alpha_{10}(3m)=\frac{2m-1}{3m-1}.α10​(3m)=3m−12m−1​.

Each repeating tail in this family consists of a single digit. Once the nonrepeating beginnings are cleared, a row either agrees with the reference in every position or misses it in every position. Whole-tail agreement gives the same count as averaging the individual digit matches here.

As mmm grows, the alignment approaches 2/32/32/3 from below. Call the distance still to go the deficit.

δ3(m)=23−α10(3m)=13(3m−1).\begin{aligned} \delta_3(m)&=\frac23-\alpha_{10}(3m)\\ &=\frac{1}{3(3m-1)}. \end{aligned}δ3​(m)​=32​−α10​(3m)=3(3m−1)1​.​

At m=4m=4m=4, the deficit is 1/331/331/33. Doubling mmm to 8 brings it down to 1/691/691/69, and doubling again gives 1/1411/1411/141. Each step leaves a little less than half the previous deficit.

In decimal, alignment rises from 7/11 to 15/23, 31/47, 63/95, and 127/191. The gaps below two thirds are 1/33, 1/69, 1/141, 1/285, and 1/573. Successive deficit ratios approach two from above. In decimal, alignment rises from 7/11 to 15/23, 31/47, 63/95, and 127/191. The gaps below two thirds are 1/33, 1/69, 1/141, 1/285, and 1/573. Successive deficit ratios approach two from above.
Doubling the supported part brings alignment closer to its ceiling. The gaps share a common scale; their ratios approach the octave ratio. Select a figure to inspect it at full size.

Dividing the first deficit by the second gives 69/33=23/1169/33=23/1169/33=23/11, a little more than 2. The next pair gives 47/2347/2347/23. As the denominators grow, these ratios approach exactly 2, the frequency ratio of an octave.

Used as a frequency ratio, each finite value gives an interval slightly wider than an octave. The next doubling brings it closer, and the formula lets us calculate the remaining error.

The fifth that decimal cannot supply

The same calculation works in other bases. Choose a prime p≥3p\geq3p≥3 dividing b−1b-1b−1, and let mmm use only prime factors of the base bbb. The denominator pmpmpm again gives one-digit repeating tails after its beginning is cleared. Its alignment approaches 2/p2/p2/p, with deficit

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

For two allowed integers uuu and vvv, scale both by a common factor ttt made from the base’s primes. The ratio of their deficits is

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

The deficit at the smaller integer goes on top because deficits decrease as the integers grow. The two subtractions by 1 keep the finite ratio slightly away from v/uv/uv/u; their effect vanishes as ttt increases.

In base 10, the allowed integers are products of 2 and 5. Their ratios give octaves and the just major third, 5/45/45/4. For example, the points 40 and 50 have ratio 5/45/45/4.

A fifth above 40 would require 60, whose factor of 3 puts it outside this grid.

No multiplication or division using only 2 and 5 gives exactly 3/23/23/2. There is a 3 in the denominator 3m3m3m, but it determines the alignment family. The allowed factors of mmm come from the base, and decimal supplies only 2 and 5.

In base 12, both 2 and 3 are available. We use p=11p=11p=11, since 11 divides 12−112-112−1, and place the allowed integers on a grid with one axis for each prime. A step to the right multiplies by 2; a step up multiplies by 3.

Base 10 permits 40, 50, 64, and 80 within this octave, but not 60. In the base-12 prime-exponent grid, one step left and one step up takes 24 to 36, giving the fifth 3/2. Base 10 permits 40, 50, 64, and 80 within this octave, but not 60. In the base-12 prime-exponent grid, one step left and one step up takes 24 to 36, giving the fifth 3/2.
Equal horizontal distances on the upper line represent equal frequency ratios. The lower grid is spaced by prime exponents. Its integers use nonnegative exponents; ratios between them allow steps in either direction.

Starting at 24, one step left and one step up brings us to 36. We have divided by 2 and multiplied by 3, giving the fifth 3/23/23/2.

These are the same prime-exponent coordinates used in Pythagorean tuning. The alignment calculation assigns a deficit to every integer point, and its ratio formula tells us how close two finite deficits come to the corresponding musical interval.

Decimal can still approximate a fifth by choosing different pairs of points. It has no fixed pair whose limiting ratio is exactly 3/23/23/2, whereas in base 12 the pair 24 and 36 does the job.

Twelve fifths and seven octaves

Twelve pure fifths take us almost, but not quite, to the same pitch as seven octaves. The discrepancy is small enough to disappear in a rough calculation and large enough to cause centuries of trouble in tuning.

Twelve fifths multiply the frequency by (3/2)12(3/2)^{12}(3/2)12. Seven octaves multiply it by 272^727. The ratio between the endpoints is

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

This is the Pythagorean comma, about 23.46 cents. A semitone in twelve-tone equal temperament is 100 cents, so the gap is almost a quarter of one. Pure fifths make a spiral, not a closed circle. Equal temperament narrows each fifth by one twelfth of the comma, measured in cents, so that twelve fifths reach seven octaves. Benson follows the arithmetic of the mismatch.

The two integers in the reduced fraction, 3123^{12}312 and 2192^{19}219, are allowed points in base 12. Put their deficits into the ratio formula.

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

This finite ratio is slightly larger than the comma. The two already agree to six significant figures, but the exact fractions retain the difference.

Twelve pure fifths end about 23.46 cents above seven octaves. The classical ratio is 531441/524288; the finite base-12 deficit ratio is 5845850/5767167, slightly larger. Twelve pure fifths end about 23.46 cents above seven octaves. The classical ratio is 531441/524288; the finite base-12 deficit ratio is 5845850/5767167, slightly larger.
The enlarged gap is the classical comma. The two fractions below distinguish that tuning ratio from the finite deficit calculation. Scaling the integer pair makes the latter approach the former.

Scaling both integer points makes the deficit ratio converge to the classical comma. The mismatch between pure fifths and octaves survives intact. Equal temperament adjusts the fifths to close the circle; increasing the deficit scale reproduces the pure intervals and their failure to close.

Eight notes from nine points

Base 30=2×3×530=2\times3\times530=2×3×5 adds the third axis. With p=29p=29p=29, the deficit now lives on the integer grid used in five-limit just intonation. The name means that no prime larger than 5 enters an interval ratio.

The just major scale has ratios

1,98,54,43,1,\quad\frac98,\quad\frac54,\quad\frac43,1,89​,45​,34​, 32,53,158,2.\frac32,\quad\frac53,\quad\frac{15}{8},\quad2.23​,35​,815​,2.

Their least common denominator is 24. Multiplying by 24 gives the integers 24, 27, 30, 32, 36, 40, 45 and 48. Each uses only 2, 3 and 5. This is a classical representation of the scale, also set out in Kurenniemi’s account of musical lattices.

The integer 25=5225=5^225=52 also lies between 24 and 48 and uses only the allowed primes.

All base-30 supported integers from 24 to 48 are 24, 25, 27, 30, 32, 36, 40, 45, and 48. The eight gold rows form the just major scale. The extra teal row at 25 gives 25/24. All base-30 supported integers from 24 to 48 are 24, 25, 27, 30, 32, 36, 40, 45, and 48. The eight gold rows form the just major scale. The extra teal row at 25 gives 25/24.
Gold marks the chosen major-scale notes; teal marks the additional integer point. The rightmost column gives exact finite deficit ratios, not the limiting just intervals. A text table is available below.

Its interval, 25/2425/2425/24, belongs to the lattice but falls outside the familiar eight-note selection. Recovering that selection still requires a musical choice. The arithmetic supplies all nine points.

Dividing consecutive just intervals gives the steps 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. The whole tones come in two sizes, 9/89/89/8 and 10/910/910/9, with 16/1516/1516/15 for the diatonic semitone.

We get the familiar whole, whole, half, whole, whole, whole, half pattern, although the whole steps are unequal in this tuning.

The fifth’s extra fraction

The finite column in the figure comes directly from the deficits. Taking the deficit at 24 over the deficit at each selected point gives (29m−1)/695(29m-1)/695(29m−1)/695.

For the fifth, m=36m=36m=36. Its finite ratio is

1043695=32+11390.\frac{1043}{695}=\frac32+\frac{1}{1390}.6951043​=23​+13901​.

The extra 1/13901/13901/1390 makes this fifth a little wide. The octave is wider too, and has the largest relative error among the eight notes, just under 0.072 percent.

Now multiply both fifth endpoints, 24 and 36, by the same allowed factor ttt. The exact excess becomes

δ29(24t)δ29(36t)=32+12(696t−1).\frac{\delta_{29}(24t)}{\delta_{29}(36t)} =\frac32+\frac{1}{2(696t-1)}.δ29​(36t)δ29​(24t)​=23​+2(696t−1)1​.

Each tenfold increase in ttt removes roughly another decimal place of error. The same convergence holds for every interval in the scale.

The finite fifth approaches 1.5 as the starting point grows from 24 to 240, 2400, and 24000. The lower plot shows relative errors for all scale notes at starting points 24, 480, and 24000. The initial Do has zero error. The finite fifth approaches 1.5 as the starting point grows from 24 to 240, 2400, and 24000. The lower plot shows relative errors for all scale notes at starting points 24, 480, and 24000. The initial Do has zero error.
The upper values follow one fifth. The lower curves follow the whole scale, using relative errors and a logarithmic axis. Exact unison is identified separately because zero cannot appear on that axis.

An octave-wide plot would hide most of the change, so the lower panel measures relative error in parts per million. Following Sol down the three curves shows the fifth approaching 3/23/23/2. The starting Do has no error because its deficit is divided by itself.

A seventh in base 210

The factors of the base determine the grid. Bases 6, 12 and 24 all supply 2 and 3, so they have the same limiting Pythagorean intervals. Bases 30, 60 and 120 supply 2, 3 and 5. Their finite deficit values can differ because the chosen prime ppp also enters the formula.

Base 210=2×3×5×7210=2\times3\times5\times7210=2×3×5×7 retains those intervals and admits a fourth prime. With p=11p=11p=11, which divides 209, deficit ratios at 4t4t4t and 7t7t7t approach the harmonic seventh, 7/47/47/4. The pair 7t7t7t and 8t8t8t gives the septimal whole tone, 8/78/78/7, in the limit. Both intervals require the new factor of 7.

The tuning lattice is classical, and any positive function behaving like a constant divided by mmm would recover its limiting ratios. The alignment-deficit coordinate comes specifically from counting repeating tails, with an exact finite correction. To my knowledge, this coordinate has not been previously described.

At the fifth, that count gives 1043/6951043/6951043/695. Subtract the musical ratio 3/23/23/2 and exactly 1/13901/13901/1390 remains. We can account for that fraction and make it as small as we please by scaling the two integer points together.

I wanted a connection that would survive contact with the mathematics. Here, even the part that is still out of tune has an exact value.

The one-digit count in any supported base

Let p≥3p\geq3p≥3 be prime with p∣b−1p\mid b-1p∣b−1, and let mmm be a positive integer whose prime factors all divide bbb. Choose a clearing length DDD with m∣bDm\mid b^Dm∣bD. Among the pm−1pm-1pm−1 proper fractions k/(pm)k/(pm)k/(pm), there are m−1m-1m−1 terminating rows. Each receives a whole credit by convention.

For the other rows, multiplication by bbb preserves the remainder modulo ppp, since b≡1(modp)b\equiv1\pmod pb≡1(modp). Their cleared tails repeat a single digit. The mmm rows with k≡1(modp)k\equiv1\pmod pk≡1(modp) share the tail of 1/(pm)1/(pm)1/(pm). The remaining (p−2)m(p-2)m(p−2)m rows do not. Thus

αb(pm)=(m−1)+mpm−1,\alpha_b(pm)=\frac{(m-1)+m}{pm-1},αb​(pm)=pm−1(m−1)+m​, δp(m)=2p−αb(pm)=p−2p(pm−1).\delta_p(m)=\frac2p-\alpha_b(pm) =\frac{p-2}{p(pm-1)}.δp​(m)=p2​−αb​(pm)=p(pm−1)p−2​.

For example, take base 12, p=11p=11p=11 and m=2m=2m=2. The denominator is 22. After one digit, 1/221/221/22 repeats the digit 6. Rows 1 and 12 match that tail; row 11 terminates. The alignment is 3/21=1/73/21=1/73/21=1/7, and its deficit from 2/112/112/11 is 3/773/773/77.

The exact difference from a limiting ratio is

ptv−1ptu−1−vu=v−uu(ptu−1).\frac{ptv-1}{ptu-1}-\frac vu =\frac{v-u}{u(ptu-1)}.ptu−1ptv−1​−uv​=u(ptu−1)v−u​.

It is positive when v>uv>uv>u. The finite interval approaches its target from above. The limit is taken along allowed factors ttt, such as successive powers of any prime dividing the base.

Exact scale values and the fifth’s convergence

The last column is δ29(24)/δ29(m)\delta_{29}(24)/\delta_{29}(m)δ29​(24)/δ29​(m). The just interval in the middle column is its limit when both points are scaled together.

Note mmm Just interval Finite ratio
Do 24 111 111
Re 27 9/89/89/8 782/695782/695782/695
Mi 30 5/45/45/4 869/695869/695869/695
Fa 32 4/34/34/3 927/695927/695927/695
Sol 36 3/23/23/2 1043/6951043/6951043/695
La 40 5/35/35/3 1159/6951159/6951159/695
Ti 45 15/815/815/8 1304/6951304/6951304/695
Do 48 222 1391/6951391/6951391/695

For a selected point mmm between 24 and 48, the relative error after scaling by ttt is (m−24)/(m(696t−1))(m-24)/(m(696t-1))(m−24)/(m(696t−1)). Its maximum occurs at 48 and equals 1/[2(696t−1)]1/[2(696t-1)]1/[2(696t−1)]. At t=1t=1t=1, the bound is 1/13901/13901/1390. The fifth’s absolute error is also 1/13901/13901/1390 at this scale, but its relative error is 1/20851/20851/2085.

Here is the fifth at six starting points. The displayed decimal values are rounded.

Starting point 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
Earlier illustrations

These illustrations from the earlier version are retained for comparison. The paired figures above separate the shrinking deficits, prime grid, comma, scale selection, and finite errors.

Earlier comparison of the intervals available from different bases.
Earlier comparison of the intervals available from different bases.
Earlier illustration of twelve fifths, seven octaves, and the Pythagorean comma.
Earlier illustration of twelve fifths, seven octaves, and the Pythagorean comma.
Earlier plot of the just major scale's finite relative errors.
Earlier plot of the just major scale’s finite relative errors.
Further reading

The prime-based description of tuning has a long history. Euler’s work, Helmholtz’s On the Sensations of Tone, and Barbour’s Tuning and Temperament provide historical background. The following accounts develop the arithmetic used here.

  • Benson, Music: A Mathematical Offering, including the Pythagorean comma and temperaments.
  • Kurenniemi, Chords, Scales, and Divisor Lattices, including the prime-exponent lattice and the integer representation of the just major scale.
  • Archibald, Mathematics and Music (1924), an earlier survey of the subject.

The alignment-deficit calculation supplies a long-division-derived coordinate on an established lattice. It is not a claim that the classical intervals or the major-scale integer sequence are new.

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

Discussion

Sign in to join the discussion.

← All articlesRead the paper →
← Previous: The Three-Tier Theorem
Next: The Coherence Decomposition →