def u(n): u,v = 1,2 for i in range(2,n+1): if n == 0: return u elif n == 1: return v else: w = u / v u = v v = w return w