listing out all the factors of each number and list out all that has prime factors up to a given variable