Write a recursive function that gets an int n and another number f that is between 0 and 3, the function returns 0 or 1 depending on the following conditions: