Search a number in an array of length n