Skip to content

Commit 559951c

Browse files
victoniAnupKumarPanwar
authored andcommitted
Lucas series added (TheAlgorithms#399)
1 parent 89f15be commit 559951c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Maths/lucasSeries.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Lucas Sequence Using Recursion
2+
3+
def recur_luc(n):
4+
if n == 1:
5+
return n
6+
if n == 0:
7+
return 2
8+
return (recur_luc(n-1) + recur_luc(n-2))
9+
10+
limit = int(input("How many terms to include in Lucas series:"))
11+
print("Lucas series:")
12+
for i in range(limit):
13+
print(recur_luc(i))

0 commit comments

Comments
 (0)