# Square root of continued fraction

Assuming I've been given a number in the form of a continued fraction. Is there a general way to write the square root of that number as continued question?

For example, consider $$1+\sqrt{2} = 2+\frac1{2+\frac1{2+\frac1{2+\dots}}} = [2;2,2,2,2,2,\dots]$$ Its square root has, according to Mathematica, the form $$\sqrt{1+\sqrt{2}} = [1; 1, 1, 4, 6, 1, 2, 2, 2, 1, \dots]$$ I don't see a pattern here. Is there one?

• There is no known pattern. If you find one, you will be famous! – GEdgar Oct 31 '15 at 13:29

According wise words of Alan Baker, the continued fractions algorithm establishes a bijective correspondence between irrational numbers $\theta$ and infinite sets of positive integers $n_0, n_1,n_2....$.
Hence for all sequence $\mathcal S$ of positive integers with no apparent pattern, there is a irrational $\theta$ whose expansion in continued fractions is $\mathcal S$. It could be maybe the case, I mean no apparent pattern, for $\sqrt{1+\sqrt{2}}$. How do you know whether or not there is a viewable pattern?
• I understand and your question it seems to me plausible, I like it. However $1+\sqrt 2$ and $\sqrt{1+\sqrt 2}$ are quite different numbers. More, a rational $r$ has a finite continued fraction but $\sqrt r$ has an infinite one in general. – Piquito Oct 18 '15 at 12:42
There will be no 'non-generalized' continued fraction with a repetitive pattern. These will always lead to values of the form $\frac{P+\sqrt{D}}{Q}$. There could be a generalized one though, having a repetitive or otherwise clear pattern. Generalized meaning that not only the $a_j$ can be any natural number from 1, but also the quotient part added to it may have a numerator unequal to 1. See for example https://en.wikipedia.org/wiki/Continued_fraction for generalized continued fractions for $\pi$ having a regular pattern.