Solve recursion