# Continued fractions and nested radicals

1. Sep 23, 2008

### soandos

is there a way to express any given root of an integer in a continued fraction? i.e. Sqrt[2] = 1 + 1/(2 + Sqrt[2] - 1) and the process can be continued infinitely to get a fraction that defines the radical with only integers.

so my question is can this kind of thing be done with any square root? any integer root?

next question is is there a way to determine the limit of the following:
Sqrt[x^0*a+Sqrt[x*a+Sqrt[x^2*a+Sqrt[x^3*a...]]]] or a similar form for a progression of numbers?

2. Sep 24, 2008

### soandos

Mathematica has a function that will take a rational or a quadratic irrational and turn it into a continued fraction.
I know a simple one for the square root of any number that is one more than a square. for example: Sqrt[17]-4 == [(Sqrt[17]-4)*(Sqrt[17]+4)]/Sqrt[17]+4
multiplying across the top one gets: 1/Sqrt[17]+4
to make the denominator the same as the original, have 1/Sqrt[17]-4+8, retaining the original value of the expression, and creating a loop back to the beginning. just add four at the very top.
what is the method for doing this manually for any square root?

3. Sep 26, 2008

### soandos

anyone have any ideas?

4. Sep 27, 2008

### Bob3141592

Any root of the form ($$\sqrt{x}$$ +a ) / b can be represented by a simple continued fraction. Consider how you solve for X = a + $$\frac{1}{b+\frac{1}{b+\cdots}}$$ using the self similarity identity.

Going for higher order roots means more complex continued fractions, that either aren't self similar or have sequences in their numerators. I have no idea how to handle those in general, and I think its impossible for there to be a general method.

5. Sep 28, 2008

### soandos

i am not sure that that form works. for Sqrt[3] i believe that b is an alternating sequence of 1,2

6. Sep 28, 2008

### Bob3141592

Yes, sorry, that's where the "a" came in. My bad typing.

You may get a repeating sequence, but it will be a finite repeat. It's just like the decimal expansion of 1/7, an infinite sequence with a repeating finite group. This covers all square roots with rational offsets.

I don't remember it now, but I came upon the formula to go from one to the other by solving (0; 1, 1, 1, 1, ... ) and (0; 2, 2, 2, ... ) and extending it to x. In the same way, solve (0; 1, 2, 1, 2, 1, 2,... ) and then generalize that. The algebra doesn't get that bad.