Write a Python function to return carol numbers


Topic: Write a Python function to return carol numbers

Solution

def carol_number(n):
    if n >= 0:
        return (2**n - 1)**2 - 2
  



List all Python Programs