Write a Python function to return Syslvester's Sequence


Topic: Write a Python function to return Syslvester's Sequence

Solution

def syslvester_seq(n):
    if n == 1:
        return 2
    if n > 1:
        return syslvester_seq(n-1)**2 - syslvester_seq(n-1) + 1
    
    



List all Python Programs