Bloomberg Interview Question

a recursion question like fibonacii.