First, consider getting rid of just the even numbers. How would you process the array to mark which ones are even?
Eventually you will also need to do this for the ones divisible by 3, divisible by 5, etc.