let $x=\sum\_{i=1}^{\infty}\delta\_i2^{-i},\ \delta\_i\in\{0,1\}$. 


Is there an algorithm that converts the sequence $(\delta\_0,\ \delta\_1,\ ...)$ of the binary digits of $x$ to the sequence $[a\_0;a\_1,\ ...]$ of its continued fraction representation?



Continued Fractions from Digit Streams
Yes, there is. The algorithm is due to [Bill Gosper](http://perl.plover.com/yak/cftalk/INFO/gosper.txt) - he is considering the more general problem of doing linear fractional transformations with continued fractions - adding $2^{-i}$ is a special case. See also [Liardet and Stambul, 1998](http://www.sciencedirect.com/science/article/pii/S0022314X98922740) for a fancier (and probably more readable) explanation.


