Showing posts with label rational numbers. Show all posts
Showing posts with label rational numbers. Show all posts

Thursday, 1 December 2022

Numbers as Sums of Two Rational Cubes

... one of the oldest questions in number theory: How many integers can be written as the sum of two cubed fractions, or, as mathematicians call them, rational numbers? The numbers 6 and 13, for example, can be written as: $$ \begin{align} 6&= \left ( \dfrac{17}{21} \right ) ^3 +  \left ( \dfrac{37}{21} \right  ) ^3\\ 13 &=  \left ( \dfrac{7}{3} \right ) ^3+ \left ( \dfrac{2}{3} \right )^3 \end{align}$$Mathematicians have suspected for decades that half of all integers can be written this way. Just as with odd and even numbers, this property appears to divide whole numbers into two equal camps: those that are the sum of two cubes, and those that aren’t.

I came across this statement in a Quanta article and it came as news to me that it was "one of the oldest questions in number theory". Well, at least now I know. My immediate thought was how to translate this problem into one involving just integers rather than fractions. It's not difficult. For an integer \(n\):$$ \begin{align} \text{if }  \left ( \frac{a}{c} \right ) ^3 + \left ( \frac{b}{c} \right  ) ^3&=n\\ \text{then }a^3+b^3&=c^3 \times n \end{align}$$Using this approach, it's easy enough to use SageMathCell to generate the result for say 13 (shown earlier). Here is the permalink. Figure 1 shows the numbers from 1 to 100 that can be written as a sum of two cubed fractions:


Figure 1: numbers in blue can be written as the sum of
two cubed rational numbers; the others cannot. 

Some of these numbers can be written as the sum of two integers cubed e.g. \(9=1^3+2^3\) or \(35=2^3+3^3\) but are of course equivalent to fractions when written as:$$ \begin{align} 9&= \left ( \dfrac{1}{1} \right ) ^3 +  \left ( \dfrac{2}{1} \right  ) ^3\\ 35 &=  \left ( \dfrac{2}{1} \right ) ^3+ \left ( \dfrac{3}{1} \right )^3 \end{align}$$The need for this clarification arises from the use of the imprecise term "fraction" whereas the term "rational number" should be used instead. Some of the pairs of rational numbers, whose cubes add to the blue numbers shown in Figure 1, are not easy to calculate. Take for instance:$$x^3+y^3=97$$The graph of this function is shown in Figure 2.


Figure 2: Geogebra

The values of \(x\) and \(y\) must be positive and lie between \(0\) and \(97^{1/3} \approx 4.5947\). Using SageMathCell, the calculation quickly times out and using my Jupyter notebook the calculation is still chugging away. It remains to be seen whether my algorithm will eventually display a solution. As the article says:

In the sum-of-two-cubes problem, the fractions involved can be enormous: The number 2,803, for example, is the sum of two cubed fractions whose denominators each have 40 digits.
The article goes on to say that:

Mathematicians have suspected for decades that half of all integers can be written this way (as a sum of the cubes of two rational numbers). Just as with odd and even numbers, this property appears to divide whole numbers into two equal camps: those that are the sum of two cubes, and those that aren’t. But nobody was able to prove this, or even give any bound on the proportion of whole numbers that fall into each camp. As far as mathematicians knew, the camp consisting of sums of rational cubes might be vanishingly small — or it might contain nearly every whole number. Mathematicians have calculated that, if something called the Birch and Swinnerton-Dyer conjecture is true (as is widely believed), about 59% of numbers up to 10 million are the sum of two rational cubes. But such data can, at best, offer hints about how the rest of the number line might behave.

What the paper discussed in this article found was that at least 2/21 (about 9.5%) and at most 5/6 (about 83%) of whole numbers can be written as the sum of two cubed fractions.

Getting back to these fractions, I discovered helpful resources at this site which assisted me in completing the following information about the sums of cubes up to 100. The list is still incomplete and I'll endeavour to complete it as time goes by. It's interesting that three different sums are given on the site for 19 and I'm wondering if the other numbers whose sums have been completed can also be represented in alternative ways.

\(1\)     pending
\(2\)     pending
\(6 = \left ( \dfrac{17}{21} \right )^3 + \left( \dfrac{37}{21} \right )^3 \) 
\(7 = \left ( \dfrac{5}{3} \right )^3 + \left( \dfrac{4}{3} \right )^3 \)
\(8\)    pending
\(9 = \left ( \dfrac{1}{1} \right )^3 + \left( \dfrac{2}{1} \right )^3 \)
\(12 = \left ( \dfrac{19}{39} \right )^3 + \left( \dfrac{89}{39} \right )^3 \)
\(13 = \left ( \dfrac{2}{3} \right )^3 + \left( \dfrac{7}{3} \right )^3 \)
\(15 = \left ( \dfrac{397}{294} \right )^3 + \left( \dfrac{683}{294} \right )^3 \)
\(16\)    pending
\(17\)    pending
\(19 = \left (\dfrac{1}{3} \right )^3 + \left (\dfrac{8}{3} \right )^3 = \left (\dfrac{5}{2} \right) ^3 + \left (\dfrac{3}{2} \right )^3 =\left ( \dfrac{92}{35} \right )^3 + \left (\dfrac{33}{35} \right )^3 \)
\(20 = \left ( \dfrac{1}{7} \right )^3 + \left( \dfrac{19}{7} \right )^3 \)
\(22\)    pending
\(26\)    pending
\(27\)    pending
\(28 = \left ( \dfrac{1}{1} \right )^3 + \left( \dfrac{3}{1} \right )^3 \)
\(30\)    pending
\(31\)    pending
\(33\)    pending
\(34\)    pending
\(35 = \left ( \dfrac{2}{1} \right )^3 + \left( \dfrac{3}{1} \right )^3 \)
\(37 = \left ( \dfrac{18}{7} \right )^3 + \left( \dfrac{19}{7} \right )^3 \)
\(42\)    pending
\(43 = \left ( \dfrac{1}{2} \right )^3 + \left( \dfrac{7}{2} \right )^3 \)
\(48 = \left ( \dfrac{34}{21} \right )^3 + \left( \dfrac{74}{21} \right )^3 \)
\(49\)    pending
\(50\)    pending
\(51\)    pending
\(53\)    pending
\(54\)    pending
\(56 = \left ( \dfrac{8}{3} \right )^3 + \left( \dfrac{10}{3} \right )^3 \)
\(58\)    pending
\(61\)    pending
\(62 = \left ( \dfrac{7}{3} \right )^3 + \left( \dfrac{11}{3} \right )^3 \)
\(63\)    pending
\(64\)    pending
\(65 = \left ( \dfrac{1}{1} \right )^3 + \left( \dfrac{4}{1} \right )^3 \)
\(67\)    pending
\(68\)    pending
\(69\)    pending
\(70 = \left ( \dfrac{17}{13} \right )^3 + \left( \dfrac{53}{13} \right )^3 \)
\(71\)    pending
\(72 = \left ( \dfrac{2}{1} \right )^3 + \left( \dfrac{4}{1} \right )^3 \)
\(75\)    pending
\(78\)    pending
\(79\)    pending
\(84\)    pending
\(85\)   pending
\(86 = \left ( \dfrac{5}{3} \right )^3 + \left( \dfrac{13}{3} \right )^3 \)
\(87\)    pending
\(89 = \left ( \dfrac{36}{13} \right )^3 + \left( \dfrac{53}{13} \right )^3 \)
\(90\)    pending
\(91 = \left ( \dfrac{3}{1} \right )^3 + \left( \dfrac{4}{1} \right )^3 \)
\(92\)    pending
\(94\)    pending
\(96 = \left ( \dfrac{38}{39} \right )^3 + \left( \dfrac{178}{39} \right )^3 \)
\(97\)    pending
\(98 = \left ( \dfrac{355}{152} \right )^3 + \left( \dfrac{669}{152} \right )^3 \)

Tuesday, 29 June 2021

Equal Temperament Tuning

Part 1 of Mathematics and Music

On February 2nd 2018, I made a short post titled The Mathematics of Music and this current post builds on the content that I first introduced there.

The idea of doing a series of posts on Mathematics and Music occurred to me recently and one of the first and most basic topic in this regard were the ratios involved in the Western musical scales. I found a very good resource for this topic titled Why 12 notes to the Octave and the author begins with this statement:

The Greeks realised that sounds which have frequencies in rational proportion are perceived as harmonious. For example, a doubling of frequency gives an octave. A tripling of frequency gives a perfect fifth one octave higher. They didn't know this in terms of frequencies, but in terms of lengths of vibrating strings. Pythagoras, who experimented with a monochord, noticed that subdividing a vibrating string into rational proportions produces consonant sounds. This translates into frequencies when you know that the fundamental frequency of the string is inversely proportional to its length, and that its other frequencies are just whole number multiples of the fundamental. 

The key point is that "sounds which have frequencies in rational proportion are perceived as harmonious" and the most important of these ratios is 3:2. The author continues:

The chromatic scale reflects this fact. In the 18th and 19th centuries, the chromatic scale was tuned using the idea of 3/2. In the most elegant of these, Thomas Young's tuning, several of the fifths were set exactly to 3/2, and the others were tempered slightly (to make octaves exact).

In the modern equal temperament (which came into practical use during the early part of the 20th century), all fifths are tuned to 2^(7/12)=1.49651..., slightly less than 3/2, and 12 repetitions of this ratio gets us back to where we started (after dropping down 7 octaves).

Of the various intervals, the only ones that are really well captured by tempered versions of the 3/2 scheme are: unison, 5th, major 2nd, and their reciprocals (octave, 4th, minor 7th).

The author then asks two key questions: 

  • Why 3/2? The choice of 3/2 says that, next to the octave, it should be regarded as the most important interval. 

  • Why do 12 steps work nicely? Interestingly, this can be explained in terms of simple number theory, namely continued fractions.
Ah, continued fractions! This is where the Mathematics comes in. The author remarks that it is necessary to understand when a power of 3/2 will be close to a power of 2 (because 2 represents an octave and we want a power of 2 that will be close to a power of 3/2). So we set an equation:$$\begin{align} \left ( \frac{3}{2}\right )^a &=2^b \text{ where }a \text{ and }b \text{ are natural numbers}\\\frac{3}{2} &=2^{\frac{b}{a}}\\&=2^x \text{ where }x \text{ is a real number}\\
x&=\frac{\log \left ( \frac{3}{2} \right )}{\log(2)}\\

&\approx 0.584962500721 \dots \end{align}$$There are no rational values of \(a\) and \(b\) that satisfy the equation which is why it is necessary to approximate with a real number \(x\). The continued fraction approximations to \(x\) are shown in the SageMath code in Figure 1 with permalink included:


Figure 1: permalink

We see that 7/12 gives a reasonable approximation (0.5833333... versus 0.5849625...). If we start with the octave between note A3 (220 Hz) and A4 (440 Hz) and divide it into 12 semitones according to \(220 \times 2^{k/12}\) where \(k=0 \dots 12\), we get what's shown in Figure 2.


Figure 2: link

Figure 3 shows what two different representations of the octaves:

Figure 3: link

As the author of Why 12 notes to the Octave remarks, there are other possible divisions and one of them is into 19 parts because 11/19 = 0.578947... is pretty close to 0.5849625... and this produces the situation shown in Figure 4 where octave is divided into 19 "semitones" according to  \(220 \times 2^{k/19}\) where \(k=0 \dots 19\).


Figure 4:  link

Let's remember that the above scales, and in fact nearly all modern scales, use equal temperament. As Wikipedia explains:
There are two main families of tuning systems: equal temperament and just tuning. Equal temperament scales are built by dividing an octave into intervals which are equal on a logarithmic scale, which results in perfectly evenly divided scales, but with ratios of frequencies which are irrational numbers. Just scales are built by multiplying frequencies by rational numbers, which results in simple ratios between frequencies, but with scale divisions that are uneven.

This is a big topic and I've only scratched the surface of it. More later. 

Saturday, 6 July 2019

Visualisation of Semiprimes

I've written previously about semiprimes in varying contexts. These posts are listed below:
I was prompted to make yet another post about them because today I turned 25661 days old and was little of interest to found about this number in either the OEIS, Numbers Aplenty or any other sources. However, it is a semiprime, being a product of 67 and 383. I thought I'd examine the number is a more detailed, two dimensional way. Figure 1 illustrates my approach.

Figure 1

I've revisited some old territory in the notes contained in Figure 1 which I've reproduced below:
The number 25661 is a semiprime because it has prime factors of 67 and 383. It can be visualised in two dimensions as a rectangle with a width of 67 units and length of 383 units. As such, its area of course is 25661 square units and its perimeter is 900 units. The ratio of the rectangle's width to its length is thus 67 383 or approximately 0.17493 and the ratio of length to width is 383: 67 or approximately 5.7164. The length of the diagonal of this rectangle is approximately equal to 388.8. The area of the rectangle is equivalent to the sum of the areas of 62 different combinations of three squares. An example is shown where the three squares has sides of 86 units, 92 units and 99 units.
By "old territory", I mean the semiprime is envisioned as a rectangle whose width and length are the smaller and larger prime factors whose product is the area of the rectangle. Thus the integers 900 and 25661 are related via a gematria-like connection. The ratio of the sides produce two other related numbers, both rational, and this case:$$ \frac{67}{383} \approx 0.17493 \text{ and its reciprocal } \frac{383}{67} \approx 5.7164$$What's new is that I've considered the length of the rectangle's diagonal which is an irrational number and equal to \( \sqrt {67^2+383^2} = \sqrt {151178} \approx 388.8162 \).

Finally, I've used the fact that 25661 can be expressed a sum of three squares in 62 different ways to represent the rectangle as being equivalent in area to the sum of any of these three squares. In Figure 1, I've used the example of:$$86^2+92^2+99^2=67 \times 383 =25661$$The square numbers correspond to \( 86^2, 92^2 \text{ and } 99^2 \text{ are } 7396, 8464 \text{ and } 9801 \text{ respectively }\). There are another 61 sets of such triplets that can be linked visually with the rectangular representation of 25661. See Figure 2:

Figure 2