a. Create a Python recursive function for the relation in #1. b. Create a Python program that uses a for loop to repeatedly invoke the recursive function you created and to print each term up to and including a6. In your HW document Include a screen shot of the Python file that contains your function code and your program code. Include a screen shot of your IDLE output
#1) Find the first 6 terms of the recurrence relation given by a1 = -1, an = 2n – an-1
Python 3 code
============================================================================================
def fun(n):
if n==1:
return -1
else:
return 2*n-fun(n-1)
for i in range(1,7):
print(i,' term is: ',fun(i))
============================================================================================
Output

a. Create a Python recursive function for the relation in #1. b. Create a Python program...