Showing posts with label square roots. Show all posts
Showing posts with label square roots. Show all posts

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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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, 30 November 2018

The Apocryphal Diderot-Euler Encounter

There is an interesting story about an encounter between Diderot and Euler in the palace of Catherine the Great in St.Peterburg. I've come across two versions of the story, one in Bell's "Men of Mathematics" and the other in Hogben's "Mathematics for the Million". Both are essentially the same and there are many other slightly differing versions about. Here is the account by Hogben:

Figure 1
This is nonsense because Diderot was an accomplished mathematician in his own right. He apparently didn't know how to respond and, embarrassed, made a quick exit. The next day he asked the Empress for safe passage back to Paris. Even though the story is apocryphal, the mathematical equation interested me (from a mathematical perspective not a theological one), so I thought I'd investigate it a little. Firstly though I imposed some restriction on a, b and n: they must be integers and all greater than zero. $$  \frac{a+b^n}{n}=x \text{   with }a, b, c >0 \text { and } a, b, c \, \in \, \, Z $$Let's consider the case where \(x=100\) and \( n=1\). We have simply:$$ a+b=100 \text{ and }b=100-a$$Thus \(a=1\) and \(b=99 \), \(a=2 \) and \(b=98 \), ..., \(a=99\) and \(b=1\) are the possible solutions.

Let's next consider the case where \(x=100\) but \(n=2\). In this case we get:$$ \frac{a+b^2}{2}=100 \text{ and }b=\sqrt{200-a}$$For this result, the values of a must be chosen so that \(\sqrt{200-a} \) is a square number. The square numbers between 0 and 200 are 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196 and correspond to \(b\) values of 1, 2, ..., 13, 14 with associated \(a\) values of 199, 196, ..., 31, 4.

In the case where \(x=100\) and \(n=3\) we get: $$ \frac{a+b^3}{3}=100 \text{ and }b=\sqrt[3]{300-a}$$Here, the values of a must be chosen so that we can find an integral cube root of the number under the cube root sign. The cubes that lie between 0 and 300 are 1, 8, 27, 64, 125 and 216 and so \(a\) values of 299, 292, 273, 236, 175 and 84 correspond to \(b\) values of 1, 2, 3, 4, 5 and 6.

As n increases, the possible values of \(a \) decrease:
  • fourth power (\(n=4\)) numbers less than 400 are 1, 16, 81 and 256
  • fifth power numbers (\(n=5\)) less than 500 are 1, 32 and 243
  • sixth power numbers (\(n=6\)) less than 600 are 1 and 64
  • seventh power numbers (\(n=7\)) less than 700 are 1 and 128
  • eighth power numbers (\(n=8\)) less than 800 are 1 and 256
  • ninth power numbers (\(n=9\)) less than 900 are 1 and 512
  • tenth power numbers (\(n=10\)) less than 1000 are 1 only
As can be seen, the multiples of 100 are soon overtaken. So just to check, let's take the case where n=9 and we want \(900-a=512\) and so \(a=388\) and \(b=2\). This means 100 can be written as:$$100=\frac{388+2^9}{9}$$From this analysis, it's clear that for any given integer \(x\) there are numerous ways to represent it in the form examined but their number is definitely finite.