def u(n, U = None): if U is None or U == []: U = [1,2] + [None] * (n-1) if U[n] is None: U[n] = u(n-2, U) / u(n-1, U) return U[n]