Continued fraction expansion

For the continued fraction expansion