algorithm successfully finds the correct numberadded a starting index number to be passed into each recursive cycle