Determining number of elements divisible by at least one prime of set
One possible approach is to use the GCD algorithm: calculate the GCD of each number in your array with the product of the given primes.