def frac_continue(n,d): solution=[] while d: a=n//d solution.append(a) n,d=d,n-a*d return solution