Get the prime factorization of a number in an array