Ok, so it is quite amazing how the continued fractions for $\sqrt[2]{x}$ are always periodic for all whole numbers of $x$ (and where $x$ is not a perfect square): Here is a link I suggest at looking at: http://mathworld.wolfram.com/PeriodicContinuedFraction.html ...
The following is in the simple continued fraction form: $$\sqrt x = a_1+ \cfrac{1}{a_2 + \cfrac{1}{a_3 + \cfrac{1}{a_4 + \cfrac{1}{a_5 + \cfrac{1}{a_6 + \cfrac{1}{a_7 + \cdots}}}}}}$$
For example:
The continued fraction of $\sqrt 7$ is as follows: $[2;1,1,1,4,1,1,1,4,1,1,1,4,\ldots]$ the period in this case is $4$... and the continued fraction can be written as:
$$[2;\overline{1,1,1,4}]$$
Some other examples:
$\sqrt2 = [1;\overline{2}]$ Period is 1
$\sqrt3 = [1;\overline{1,2}]$ Period is 2
$\sqrt{13} = [3;\overline{1,1,1,1,6}]$ Period is 5
$\sqrt{97} = [9;\overline{1,5,1,1,1,1,1,1,5,1,18}]$ Period is 11
There are many other sources which show this... but why does this not work for others, such as cubic roots? I have written a java program to compute the continued fraction for the nth root of the numbers between $1$ and $100$ (excluding perfect squares,etc...) for the first 100 terms. Here are the results:
$\sqrt[2]{x}$: http://pastebin.com/ZcasfRyP
$\sqrt[3]{x}$: http://pastebin.com/XG9UF8hR
$\sqrt[4]{x}$: http://pastebin.com/Edp307SE
$\sqrt[5]{x}$: http://pastebin.com/9SwwPqUa
As you can see no period...
So why is it periodic for square roots, but not for others? An extension of the question: https://math.stackexchange.com/questions/1898902/periodic-continued-fractions-of-non-square-root-numbers-sqrtax-where-a
Kind Regards
Joshua Lochner
It's because periodicity of a simple continued fraction amounts to a quadratic equation. I will illustrate this by means of an example: $$ 7 + \cfrac 1 {2 + \cfrac 1 {3+\cfrac 1 {9 + \cdots\vphantom{\dfrac 1 1}}}} $$ and assume $2,\,3,\,9$ repeats. We have $$ 7,\ \overbrace{2,3,9,}\ \overbrace{2,3,9,}\ \overbrace{2,3,9,}\ \overbrace{2,3,9,}\ \ldots $$ This is $$ -2 + \left(9 + \cfrac 1 {2 + \cfrac 1 {3+\cfrac 1 {9 + \cdots\vphantom{\dfrac 1 1}}}} \right) \tag 1 $$ so that $9,\ 2,\ 3$ repeats right from the beginning.
Let $x = {}$the continued fraction in $(1)$, with $9,\ 2,\ 3$ repeating.
Then we get $$ x = 9 + \cfrac 1 {2 + \cfrac 1 {3 + \cfrac 1 x}} $$ Then, since $\dfrac 1 {3+\cfrac 1 x} = \dfrac x {3x+1}$, we have $$ x = 9 + \cfrac 1 {2 + \cfrac x {3x+1}}. $$ Now multiply the numerator and denominator of the fraction after $9+\cdots$ by $3x+1$, getting $$ x = 9 + \dfrac{3x+1}{7x+2} $$ so $$ x = \frac{66x+ 19}{7x+2}. $$ Multiply both sides by $7x+2$: $$ x(7x+2) = 66x+19. $$ And there you have a quadratic equation.