Find a number matching the index in a given array