Using Python to randomly generate patterns out of the prime factors of numbers.