Skip to content

Commit

Permalink
Lucas series added (TheAlgorithms#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
victoni authored and AnupKumarPanwar committed May 26, 2019
1 parent 89f15be commit 559951c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Maths/lucasSeries.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 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))

0 comments on commit 559951c

Please sign in to comment.