Python/maths/lucas series.py
Anup Kumar Panwar 4e413c0183 Updated README
2019-07-06 11:11:20 +05:30

14 lines
285 B
Python

# Lucas Sequence Using Recursion
def recur_luc(n):
if n == 1:
return n
if n == 0:
return 2
return (recur_luc(n-1) + recur_luc(n-2))
limit = int(input("How many terms to include in Lucas series:"))
print("Lucas series:")
for i in range(limit):
print(recur_luc(i))