You need to stack the indexes as you go, and assign the recursive function a success flag. When you perform a recursive call, you push the new index. When the function returns, in case of failure you pop and continue the search, and in case of success you do nothing but return success. In the end, the stack will be either empty or filled with the solution.
The stack can be a global variable or be passed as an argument.