Bloomberg interview question

a recursion question like fibonacii.