Showing posts with label continued fraction. Show all posts
Showing posts with label continued fraction. Show all posts

Tuesday, 1 July 2025

An Unusual Application of Continued Fractions

Yesterday I turned 27487 days old. This is a prime number of days and this number together with the next three prime numbers form the following sequence:$$27847, 27851, 27883, 27893$$Now let's combine these numbers together to from a continued fraction:

                    1            
27847 + -------------------------
                        1        
         27851 + ----------------
                             1   
                  27883 + -------
                           27893 

This continued fraction is equivalent to the improper fraction:$$ \dfrac{603189725547991331} {21660851250413}$$with both numerator and denominator being prime. The first of the primes, 27847, qualifies it for membership in OEIS A270884:


A270884: smallest of FOUR consecutive prime numbers that when represented as a simple continued fraction, generates prime numbers in the numerator and denominator, when reduced.


The initial members are (permalink):

41, 367, 619, 659, 701, 2267, 2789, 3253, 3463, 6917, 8969, 9221, 11959, 13499, 14431, 17359, 17851, 20143, 22283, 23669, 26107, 27847, 28547, 28879, 29537, 32503, 32717, 32987, 37549

Let's look at the first of these numbers, 41, for another example. The four primes are thus 41, 43, 47 and 53.

            1        
41 + ----------------
               1     
      43 + ----------
                  1  
            47 + ----
                  53 

Here the continued fraction is equal to:$$ \frac{4398061} {107209}$$with both numerator and denominator being prime. Up to one million, the continued fractions of five and six runs of consecutive primes do not produce improper fractions with numerators and denominators that are prime. However, some runs of seven consecutive primes do. Up to 40,000 these are 223, 1579, 5881, 8293, 9013, 12347, 15121, 17783, 25523 and 38903 (permalink). Let's look at the first of these: 223.

                         1                    
223 + ----------------------------------------
                             1                
       227 + ---------------------------------
                                1             
              229 + --------------------------
                                    1         
                     233 + -------------------
                                       1      
                            239 + ------------
                                           1  
                                   241 + -----
                                          251 

This produces the fraction:$$ \frac{39053357680436977}{175123705045789} $$with both numerator and denominator prime. No numbers satisfy for runs of eight and nine consecutive primes but for runs of ten we have 5519, 13037, 18743 and 39857 (permalink). Let's look at 5519. The continued fraction (this time in compact format) is:$$ \begin{align} &5519; 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591]\\  \\ &= \frac{27886154132102326260514832393879709899}{5052754705003449540186402260387567} \end{align}$$with the numerator and denominator prime.

Wednesday, 27 April 2022

POBA: Primes Only Best Approximate

It takes a little getting used to the concept of what a POBA or Primes Only Best Approximate is. One definition runs:

"Suppose that \( x > 0 \). A fraction \( p/q \) of primes is a primes-only best approximate (POBA), and we write "\( p/q \) in B( \( x \) )", if \(0 < |x - p/q| < |x - u/v| \) for all primes \(u\) and \(v\) such that \(v < q\), and also, \( |x - p/q| < |x - p'/q|  \) for every prime \(p'\) except \(p\). Note that for some choices of \(x\), there are values of \(q\) for which there are two POBAs. In these cases, the greater is placed first; e.g., B(3) = (7/2, 5/2, 17/5, 13/5, 23/7, 19/7, ...)." 

Things become clearer if we look at a specific example. On April 23rd 2022, I turned 26683 days old and one of the properties of this number is that it's a member of OEIS A265788:


 A265788

Numerators of primes-only best approximates (POBAs) to \( \sqrt{5} \).          


The POBAs to start with are 3/2, 5/2, 7/3, 11/5, 29/13, 163/73, 199/89, 521/233. The initial members of the sequence are thus 3, 5, 7, 11, 29, 163, 199, 521 (with the continuation being 3571, 26683, 111667, 150427, 154841 etc.). Table 1 shows the initial approximations:


Table 1: permalink POBAs for \( \sqrt{5}\)

The convergence is far slower than with the continued fraction  where the numerator and denominator of each fraction are coprime. See Table 2 and note that scientific notation is used once the difference becomes very small.


Table 2: permalink continued fraction approximations for \( \sqrt{5} \)

The SageMath algorithm I developed is rather sluggish but it can be easily modified to accommodate other irrational or transcendental numbers such as \( \pi \). See Table 3 for the POBAs for \( \pi \).


Table 3: permalink POBAs for \( \pi \)

Once again, the continued fractions are far more efficient and the display quickly changes to scientific notation because of the small differences. See Table 4 for the continued fraction approximations of \( \pi \).


Table 4: permalink continued fraction approximations for \( \pi \)

Let's not forget that the continued fractions for irrational and transcendental numbers offer the best approximations. While the POBAs are clearly less efficient, they are nonetheless interesting in their own right. Further variations can be envisaged such as fractions whose numerators and denominators consist of only Fibonacci numbers rather than primes.

Friday, 11 February 2022

Khinchin's Constant

As I said in my previous post, Twin Prime Constant, the following standard mathematical constants are defined in SageMath:
  • pi
  • golden_ratio
  • log2
  • euler_gamma
  • catalan
  • khinchin
  • twinprime
  • mertens
I'm familiar with all the constants above except two: the twinprime constant and the khinchin constant. I've dealt with the former and so this post is about the latter. To quote from Wikipedia:
Aleksandr Yakovlevich Khinchin proved that for almost all real numbers \(x\), coefficients \(a_i\) of the continued fraction expansion of \(x\) have a finite geometric mean that is independent of the value of \(x\) and is known as ''Khinchin's constant''. That is, for$$x = a_0+\cfrac{1}{a_1+\cfrac{1}{a_2+\cfrac{1}{a_3+\cfrac{1}{\ddots}}}}$$it is almost always true that$$\lim_{n \rightarrow \infty } \left( a_1 a_2 ... a_n \right) ^{1/n} = K_0$$where \(K_0\) is Khinchin's constant which is equal to$$\prod_{r=1}^\infty {\left( 1+{1\over r(r+2)}\right)}^{\log_2 r}  \approx 2.6854520010\dots$$Although almost all numbers satisfy this property, it has not been proven for ''any'' real number ''not'' specifically constructed for the purpose. Among the numbers \(x\) whose continued fraction expansions are known ''not'' to have this property are rational numbers, roots of quadratic equations (including the golden ratio, the square roots of integers) and the base of the natural logarithm \(e\).

\( \pi \), the Euler–Mascheroni constant \( \gamma \), and Khinchin's constant itself, based on numerical evidence, are thought to be among the numbers whose geometric mean of the coefficients \(a_i\) in their continued fraction expansion tends to Khinchin's constant. However, none of these limits have been rigorously established. It is not known whether Khinchin's constant is a rational, algebraic irrational or transcendental number.
Let's look at Wolfram MathWorld's article on the Euler-Mascheroni Constant Continued Fraction in which the continued fraction for \( \gamma \) is given as:

[0; 1, 1, 2, 1, 2, 1, 4, 3, 13, 5, 1, 1, 8, 1, 2, 4, 1, 1, 40, ...] (OEIS A002852)

SageMathCell (permalink) can display what this continued fraction looks like. See Figure 1.

Figure 1: permalink

Figure 2 shows a plot of the progressive harmonic means of successive values of \(a_1^{1/1}, (a_1.a_2)^{1/2}, (a_1.a_2...a_n)^{1/n} \) that appear to approach Khinchin's constant, although this has not been rigorously proven:

Figure 2: source

Figure 2 shows a rather more complicated plot of the values \( (a_1.a_2,...,a_n)^{1/n} \) for \(n\)=1 to 500 and \(x=\pi, \sin 1\), the Euler-Mascheroni constant \( \gamma\), and the Copeland-Erdős constant \(C\). The horizontal line marked \(K\) in the plot is Khinchin's constant.

Figure 2: source

I've mentioned the geometric mean briefly in posts titled Root-Mean-Square And Other Means on September 13th 2020 and Reciprocals of Primes on October 30th 2021. This mean is one of the three Pythagorean means along with the arithmetic and harmonic. I definitely need to dedicate a post to these three means.

Wednesday, 8 December 2021

Thue-Morse Constant

On June 20th 2020, I made a post titled Prouhet-Thue-Morse Sequence named for Eugène Prouhet, Axel Thue, and Marston Morse (the Prouhet reference is sometimes omitted). By the way, the Thue part is named after Axel Thue, whose name is pronounced as if it were spelled "Tü" where the ü sound is roughly as in the German word üben. It is incorrect to say "Too-ee" or "Too-eh". Thus sayeth N. J. A. Sloane, June 12th 2018, in his comments about OEIS A010060 that lists the members of the sequence. 

It is a most interesting sequence and my blog post covers it quite well and has links to three interesting YouTube videos. However, there is a so-called Thue-Morse constant that is the topic of this post. The sequence begins:

 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, ... 

If we concatenate these binary digits, we get a binary number:

 \(P=0.0110100110010110100101100..._2\) 

This number can be converted a decimal and is represented by the Greek letter \( \tau \):$$\tau=\sum_{n=0}^{\infty} \frac{t_i}{2^{i+1}}=0.4124540336401075977 \dots$$where \(t_i\) is the \(i^{th}\) element of the binary Thue-Morse sequence. The number has been shown to be transcendental.

Figure 1 provides two interesting expressions for the Thue-Morse constant (source):


Figure 1

I came across the constant by means of my diurnal age investigation, discovering that the number associated with my diurnal age (26547) was a member of OEIS A096394:


 A096394

Engel expansion of Thue-Morse constant.                                 


The sequence begins 3, 5, 6, 9, 12, 19, 92, 173, 242, 703, 1861, 3186, 4746, 7843, 26547, ... and the comments state that:$$ 0.4124540336 \dots = \frac{1}{3}+\frac{1}{3 \times 5}+\frac{1}{3 \times 5 \times 6}+\frac{1}{3 \times 5 \times 6 \times 9} + \dots$$I made a post about Engel Expansions way back on September 28th 2016.

If we take 0.412454033640107597783361368258455283089 as an approximation of \(\tau\) and plug this into the SageMathCell formula listed in this post, we do confirm that 26547 is a member. To generate further members of the sequence however, the number of decimal places to which \( \tau \) needs to be approximated must be increased. Here is a permalink to SageMathCell while the code is listed below (blue for input and red for output).

x=0.412454033640107597783361368258455283089
u=x
E=[1]
F=[]
product=1
sum=0
for i in [1..15]:
    a=ceil(1/u)
    u=u*a-1
    E.append(a)
    product=product*a
    sum+=1/product
    F.append(1/product)
print(E, "... this is the Engels expansion")

[1, 3, 5, 6, 9, 12, 19, 92, 173, 242, 703, 1861, 3186, 4746, 7843, 26547] ... this is the Engels expansion

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. 

Monday, 21 December 2020

Continued Fractions of Square Roots

It's all too easy, using online resources like WolframAlpha or SageMathCell, to extract a variety of information about continued fractions. For example, today I turned \(26195\) days old and this number is a member of OEIS A042431:


  A042431

Denominators of continued fraction convergents to \( \sqrt{743} \).   



To confirm that \(26195\) is indeed a member of this sequence, I would normally use SageMathCell but others would turn to WolframAlpha and, using the latter, it can be seen in Figure 1 that \(26195\) is indeed a denominator in one of the convergent fractions, specifically:$$ \displaystyle \frac{714024}{26195}$$

Figure 1

It's easy to take for granted that the continued fraction of an irrational number that is a square root (like \( \sqrt{743} \)) is always periodic. A good explanation of why this is so can be found on this site. In the following, I'm reproducing the site's conversion of \( \sqrt{5} \) to a continued fraction (and practising my LaTeX at the same time).
$$\begin{aligned}
\sqrt{5}&=2+x\\
5&=(2+x)^2 \\
&=4+4x+x^2\\
&=4+x\,(4+x)\\
5-4&=x\,(4+x)\\
1&=x\,(4+x)\\
x&=\frac{1}{4+x}\\
\text{ Thus } \sqrt{5}&=2+\frac{1}{4+x}\\
&=2+\frac{1}{4+\displaystyle \frac{1}{4+x}}\\
&=2+\frac{1}{4+\displaystyle \frac{1}{4+\displaystyle \frac{1}{4+x}}} \text{ etc.}\\
\end{aligned}$$Clearly, we can write \( \sqrt{5}=[2;\overline 4]\) where the overline represents repetition. In the case of \( \sqrt{743}\), we have \([27;\overline{3,1,7,27,7, 1, 3, 54}]\). The site referred to earlier goes on to develop a general algorithm for determining the periodic continued fraction of any irrational square root. The table at the end of this post lists the continued fractions of the square roots of the first 99 natural numbers (even those that aren't irrational). 

√n[ a; Period ]
√1[ 1; ]
√2[ 1; 2 ]
√3[ 1; 1, 2 ]
√4[ 2; ]
√5[ 2; 4 ]
√6[ 2; 2, 4 ]
√7[ 2; 1, 1, 1, 4 ]
√8[ 2; 1, 4 ]
√9[ 3; ]
√10[ 3; 6 ]
√11[ 3; 3, 6 ]
√12[ 3; 2, 6 ]
√13[ 3; 1, 1, 1, 1, 6 ]
√14[ 3; 1, 2, 1, 6 ]
√15[ 3; 1, 6 ]
√16[ 4; ]
√17[ 4; 8 ]
√18[ 4; 4, 8 ]
√19[ 4; 2, 1, 3, 1, 2, 8 ]
√20[ 4; 2, 8 ]
√21[ 4; 1, 1, 2, 1, 1, 8 ]
√22[ 4; 1, 2, 4, 2, 1, 8 ]
√23[ 4; 1, 3, 1, 8 ]
√24[ 4; 1, 8 ]
√25[ 5; ]
√26[ 5; 10 ]
√27[ 5; 5, 10 ]
√28[ 5; 3, 2, 3, 10 ]
√29[ 5; 2, 1, 1, 2, 10 ]
√30[ 5; 2, 10 ]
√31[ 5; 1, 1, 3, 5, 3, 1, 1, 10 ]
√32[ 5; 1, 1, 1, 10 ]
√33[ 5; 1, 2, 1, 10 ]
√34[ 5; 1, 4, 1, 10 ]
√35[ 5; 1, 10 ]
√36[ 6; ]
√37[ 6; 12 ]
√38[ 6; 6, 12 ]
√39[ 6; 4, 12 ]
√40[ 6; 3, 12 ]
√41[ 6; 2, 2, 12 ]
√42[ 6; 2, 12 ]
√43[ 6; 1, 1, 3, 1, 5, 1, 3, 1, 1, 12 ]
√44[ 6; 1, 1, 1, 2, 1, 1, 1, 12 ]
√45[ 6; 1, 2, 2, 2, 1, 12 ]
√46[ 6; 1, 3, 1, 1, 2, 6, 2, 1, 1, 3, 1, 12 ]
√47[ 6; 1, 5, 1, 12 ]
√48[ 6; 1, 12 ]
√49[ 7; ]
√50[ 7; 14 ]
√n[ a; Period ]
√51[ 7; 7, 14 ]
√52[ 7; 4, 1, 2, 1, 4, 14 ]
√53[ 7; 3, 1, 1, 3, 14 ]
√54[ 7; 2, 1, 6, 1, 2, 14 ]
√55[ 7; 2, 2, 2, 14 ]
√56[ 7; 2, 14 ]
√57[ 7; 1, 1, 4, 1, 1, 14 ]
√58[ 7; 1, 1, 1, 1, 1, 1, 14 ]
√59[ 7; 1, 2, 7, 2, 1, 14 ]
√60[ 7; 1, 2, 1, 14 ]
√61[ 7; 1, 4, 3, 1, 2, 2, 1, 3, 4, 1, 14 ]
√62[ 7; 1, 6, 1, 14 ]
√63[ 7; 1, 14 ]
√64[ 8; ]
√65[ 8; 16 ]
√66[ 8; 8, 16 ]
√67[ 8; 5, 2, 1, 1, 7, 1, 1, 2, 5, 16 ]
√68[ 8; 4, 16 ]
√69[ 8; 3, 3, 1, 4, 1, 3, 3, 16 ]
√70[ 8; 2, 1, 2, 1, 2, 16 ]
√71[ 8; 2, 2, 1, 7, 1, 2, 2, 16 ]
√72[ 8; 2, 16 ]
√73[ 8; 1, 1, 5, 5, 1, 1, 16 ]
√74[ 8; 1, 1, 1, 1, 16 ]
√75[ 8; 1, 1, 1, 16 ]
√76[ 8; 1, 2, 1, 1, 5, 4, 5, 1, 1, 2, 1, 16 ]
√77[ 8; 1, 3, 2, 3, 1, 16 ]
√78[ 8; 1, 4, 1, 16 ]
√79[ 8; 1, 7, 1, 16 ]
√80[ 8; 1, 16 ]
√81[ 9; ]
√82[ 9; 18 ]
√83[ 9; 9, 18 ]
√84[ 9; 6, 18 ]
√85[ 9; 4, 1, 1, 4, 18 ]
√86[ 9; 3, 1, 1, 1, 8, 1, 1, 1, 3, 18 ]
√87[ 9; 3, 18 ]
√88[ 9; 2, 1, 1, 1, 2, 18 ]
√89[ 9; 2, 3, 3, 2, 18 ]
√90[ 9; 2, 18 ]
√91[ 9; 1, 1, 5, 1, 5, 1, 1, 18 ]
√92[ 9; 1, 1, 2, 4, 2, 1, 1, 18 ]
√93[ 9; 1, 1, 1, 4, 6, 4, 1, 1, 1, 18 ]
√94[ 9; 1, 2, 3, 1, 1, 5, 1, 8, 1, 5, 1, 1, 3, 2, 1, 18 ]
√95[ 9; 1, 2, 1, 18 ]
√96[ 9; 1, 3, 1, 18 ]
√97[ 9; 1, 5, 1, 1, 1, 1, 1, 1, 5, 1, 18 ]
√98[ 9; 1, 8, 1, 18 ]
√99[ 9; 1, 18 ]

Friday, 22 March 2019

Champernowne constant

Yesterday, on the plane from Jakarta to Singapore, I was browsing The Story of Numbers by Mallik Asok Kumar and came across the following entry shown in Figure 1:

Figure 1: extract from page 114 of Mallik's The Story of Numbers


This struck a chord because earlier in the day, sitting in Starbuck's at Jakarta airport and analysing my number of the day (25554), I'd come across this entry in the Online Encyclopaedia of Integer Sequences (OEIS) shown in Figure 2:


Figure 2: OEIS A224896

What this meant was the sequence of digits 666666 occurs at position number 25554 in the decimal expansion of the Champernowne constant. Today, I had a look at the information contained in the Wikipedia entry for this topic. It explained that the Champernowne constant can be expressed as an infinite sequence:$$C_{m}=\sum_{n=1}^\infty\frac n{10_b^{~\left(\sum\limits_{k=1}^n\left\lceil\log_{10_b}(k+1)\right\rceil\right)}}$$where \(\lceil{x}\rceil = \)ceiling(\(x\)), \(10_b^{~x}=b^x\) in base 10, \(\log_{10_b}(x)=\log_{b_{10}}(x)\) and \(b\) is the base of the constant. However, a slightly different expression is given by Eric W. Weisstein (MathWorld):$$C_{m}=\sum_{n=1}^\infty\frac n{m^{\left(n+\sum\limits_{k=1}^{n-1}\left\lfloor\log_m(k+1)\right\rfloor\right)}}$$where \(\lfloor{x}\rfloor =\) floor function. I've no idea how these summations were arrived at but in order to determine positions listed in Figure 2, the SageMath code shown in Figure 4 can be used. The example shows the position of 88888888:

Figure 4: screenshot showing position of 88888888.
Click here to verify yourself in SageMathCell

Furthermore, the general name given to sequences like OEIS A224896 is the Earls Sequence, as explained in Figure 3.

Figure 3: The Earls Sequence showing the Champernowne constant
as well as other well known constants

Getting back to Champernowne's constant, its continued fraction expansion does not terminate (because it is not rational) and is aperiodic (because it is not an irreducible quadratic, Kurt Mahler having shown that the constant is transcendental). The terms in the continued fraction expansion exhibit very erratic behaviour, with extremely large terms appearing between many small ones e.g.
[0; 8, 9, 1, 149083, 1, 1, 1, 4, 1, 1, 1, 3, 4, 1, 1, 1, 15,
4 57540 11139 10310 76483 64662 82429 56118 59960 39397 10457 55500 06620 04393 09026 26592 56314 93795 32077 47128 65631 38641 20937 55035 52094 60718 30899 84575 80146 98631 48833 59214 17830 10987,
6, 1, 1, 21, 1, 9, 1, 1, 2, 3, 1, 7, 2, 1, 83, 1, 156, 4, 58, 8, 54, ... ]
To quote further from Wikipedia:
The large number at position 19 has 166 digits, and the next very large term at position 41 of the continued fraction has 2504 digits. The fact that there are such large numbers as terms of the continued fraction expansion is equivalent to saying that the convergents obtained by stopping before these large numbers provide an exceptionally good approximation of the Champernowne constant.

Saturday, 2 March 2019

Metallic Means

A Numberphile video on YouTube caught my attention recently. It was titled The Silver Ratio and I was prompted to investigate further.


I'll attempt to recapitulate what I discovered by watching this video and doing some additional investigation. The whole concept of Metallic Means is a generalisation of the Golden Mean. One way to approach matters is geometrically via the Golden Rectangle (Figure 1).
Figure 1: The Golden Rectangle
This rectangle has the property that \(a \div b=(a+b) \div a \) which can be rewritten as \( a^2=ab+b^2 \). Without loss of generality, we can simplify matters by letting \(b=1\) since it is the ratio that we are interested in and not any actual values of \(a\) and \(b\). This leads to \(a^2=a+1\) which can be rewritten as \( a^2-a-1=0 \). Solving this quadratic yields two solutions, one positive and one negative. Because we are dealing with positive lengths, we can ignore the negative solution. The positive solution is the familiar \( (1+\sqrt 5)/2 \) designated using the Greek letter \( \phi \). 

The equally famous Fibonacci spiral derives from the Golden Rectangle (Figure 2). If a square is removed from the rectangle, then the rectangle remaining is also a Golden Rectangle ad infinitum. The circular segments that can be inserted into each progressive square combine to form the spiral shown.

Figure 2: The Golden Spiral

The Silver Mean can be derived in a similar fashion from the so-called Silver Rectangle that has the dimensions shown in Figure 3. This rectangle has the property that \(a \div b=(2a+b) \div a \) which can be rewritten as \( a^2=2ab+b^2 \). Without loss of generality, we can again simplify matters by letting \(b=1\) and this leads to \(a^2=2a+1\) which can be rewritten as \( a^2-2a-1=0 \). Solving this quadratic yields two solutions, one positive and one negative. Because we are dealing with positive lengths, we can ignore the negative solution. The positive solution is \( (2+\sqrt 8)/2 \) which can be simplified to \( 1+\sqrt 2 \) and this is the Silver Mean or Silver Ratio. 

Figure 3: The Silver Rectangle

In the Silver Rectangle, removing two squares at a time leaves another rectangle of the same dimensions ad infinitum. The inscribed parts of the circles in the squares join together to form the characteristic spiral of the silver variety as shown in Figure 4.

Figure 4: The Silver Spiral

This process can be continued and what might be called the Bronze Rectangle is the result. Figure 5 is useful in comparing the relative dimensions of the Gold, Silver and Bronze Rectangles.

Figure 5: A comparison of the Golden, Silver and Bronze Rectangles

Looking at the progression of the numbers under the square root sign, it's immediately apparent that a Fibonacci progression is in play. The dimensions of the next rectangle would be \( (1+\sqrt 21)/2 \) and so on. Let's follow up on the Fibonacci connection by looking at the ratio of progressive pairs of terms in this sequence. The terms are 0, 1, 1, 2, 3, 5, 8, 13, 21, ... and it's well known the ratio of progressive pairs of terms approaches the Golden Mean. If we write the \(n-th\) Fibonacci term as \(F_n\) then the relationship between terms is given by:$$ F_n=\begin{cases}0&\mbox{if }n=0;\\1&\mbox{if }n=1;\\F_{n-1}+F_{n-2}&\mbox{otherwise.}\end{cases} $$With the Silver Mean, the relationship is given by:$$ P_n=\begin{cases}0&\mbox{if }n=0;\\1&\mbox{if }n=1;\\2P_{n-1}+P_{n-2}&\mbox{otherwise.}\end{cases} $$This leads to the following sequence of terms: 0, 1, 2, 5, 12, 29, ... which is known as the Pell sequence. With the Bronze Mean, the relationship is given by: $$ T_n=\begin{cases}0&\mbox{if }n=0;\\1&\mbox{if }n=1;\\3T_{n-1}+T_{n-2}&\mbox{otherwise.}\end{cases} $$Here the progression of terms is: 0, 1, 3, 10, 33, 109, ... and so, in the most general case, we have a quadratic equation of the form \(a^2-k \times a -1 \) with positive solution \( (k+ \sqrt {k^2+4}) \div 2 \) and a relationship given by:$$ T_n=\begin{cases}0&\mbox{if }n=0;\\1&\mbox{if }n=1;\\k \times T_{n-1}+T_{n-2}&\mbox{otherwise.}\end{cases}$$where \(k\) is any integer greater than or equal to 1. So we've looked at the metallic means geometrically and in terms of Fibonacci-type sequences but they can also be looked at in terms of continued fractions. 

For the Golden Mean: \( (1+\sqrt 5) \div 2 \), the convergents are 2, 3/2, 5/3, 8/5, 13/8, 21/13, 34/21, 55/34, 89/55 ... and the continued fraction is:

1 + -------------------------------------------------
                              1                   
     1 + --------------------------------------------
                                 1                 
          1 + ---------------------------------------
                                   1               
               1 + ----------------------------------
                                      1           
                    1 + -----------------------------
                                        1         
                         1 + ------------------------
                                           1       
                              1 + -------------------
                                             1     
                                   1 + --------------
                                                1 
                                        1 + ---------
                                             1 + ...

For the Silver Mean: \( (2 + \sqrt 8) \div 2 \), the convergents are 5/2, 12/5, 29/12, 70/29, 169/70, 408/169, 985/408, 2378/985, 5741/2378, ... and the continued fraction is:

                            1                     
2 + -------------------------------------------------
                              1                   
     2 + --------------------------------------------
                                 1                 
          2 + ---------------------------------------
                                   1               
               2 + ----------------------------------
                                      1           
                    2 + -----------------------------
                                        1         
                         2 + ------------------------
                                           1       
                              2 + -------------------
                                             1     
                                   2 + --------------
                                                1 
                                        2 + ---------
                                             2 + ...

For the Bronze Mean: \( (3 + \sqrt 13 ) \div 2 \), the convergents are 10/3, 33/10, 109/33, 360/109, 1189/360, 3927/1189, 12970/3927, 42837/12970, 141481/42837, ... and the continued fraction is:

                            1                     
3 + -------------------------------------------------
                              1                   
     3 + --------------------------------------------
                                 1                 
          3 + ---------------------------------------
                                   1               
               3 + ----------------------------------
                                      1           
                    3 + -----------------------------
                                        1         
                         3 + ------------------------
                                           1       
                              3 + -------------------
                                             1     
                                   3 + --------------
                                                1 
                                        3 + ---------
                                             3 + ...


and so on and so on.