Answer:
To solve Exercise 12.4, you can write a recursive method that accepts a positive integer n and finds the nth Hofstadter number. The recursive method can be defined as follows:
```
def hofstadter_number(n):
if n == 1 or n == 2:
return 1
else:
return hofstadter_number(n - hofstadter_number(n - 1)) + hofstadter_number(n - hofstadter_number(n - 2))
```
To solve Exercise 12.6, you can write a recursive method that returns the value of N! (N factorial) using the definition given in this chapter. The recursive method can be defined as follows:
```
def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n - 1)
```
Normally, you would not use recursion to solve this problem because there is a much simpler and more efficient iterative solution. The iterative solution can be defined as follows:
```
def factorial(n):
result = 1
for i in range(1, n+1):
result *= i
return result
```
don't forget the brilliant mark