Recursive function with a one integer parameter

24 Views Asked by At

I am trying to come up with a recursive function which takes a single integer as a starting value. Just a single example is provided and initial value is 9. Example is as follows:

Input:
9
Output:
2
4
9

Each row in the output section represents a return value of a single iteration(2 is the result of f(9)). Question also implies that this output is a result of an algorithm. However, i was not able to find any algorithm that produces this result.

Thanks in advance for any kind of help...