Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #returns nth term of sequence
- def nth_term(n):
- if n==1:
- return 1
- def helper(curr_n):
- if curr_n == n:
- return (1 + curr_n)**0.5
- else:
- return (1 + curr_n * helper(curr_n+1))**0.5
- return helper(2)
- print([nth_term(i) for i in range(1,41)])
Add Comment
Please, Sign In to add comment