def rational_to_cfrac(n,d):
    """
    Terms of the simple continued fraction representation of n/d
    """
    
    out = []
    
    while d != 0:
        i = n//d
        out.append(i)
        
        n,d = d,n-(d*i)
    
    return out