I have a continued fraction in List form: $[0;1,2,1,2...]$ (the $1,2$ are repeated).
Evaluating this should give $-1 + \sqrt3$.
I am not sure how to get that answer.
I am aware of to express $\sqrt3$ in such a form by doing the following
I have a continued fraction in List form: $[0;1,2,1,2...]$ (the $1,2$ are repeated).
Evaluating this should give $-1 + \sqrt3$.
I am not sure how to get that answer.
I am aware of to express $\sqrt3$ in such a form by doing the following
Copyright © 2021 JogjaFile Inc.
every repeating CF will be a quadratic irrational.
The CF you wrote is this:
$$\alpha = 0 + \cfrac{1}{1 + \cfrac{1}{2 + \cfrac{1}{1 + \cfrac{1}{2 + \ddots}}}} = 0 + \cfrac{1}{1 + \cfrac{1}{2 + \alpha}}$$
now we can just work with that equation:
$$\alpha = 1/(1+1/(2+\alpha))$$
$$1/\alpha - 1 = 1/(2+\alpha)$$ $$(1 - \alpha)/\alpha = 1/(2+\alpha)$$ $$(2+\alpha)(1 - \alpha) = \alpha$$
to get a simple quadratic equation. The value of the CF is of course the positive root of that.