import math
def continued_fraction(x, y, length_tolerance):
    output = []
    big = max(x, y)
    small = min(x, y)
    while small > 0 and len(output) < length_tolerance:
        quotient = math.floor(big/small)
        output.append(quotient)
        new_small = big % small
        big = small
        small = new_small
    return(output)
