Recursive function that takes in an array of numbers and finds the one closest to the entered number