# Pastebin gQzdM9YO here is my code: def check_prime(n) i = 2 for i in 2..(n - 1) if (n % i) == 0 return false else true end end end def prime_factors(num) primes = [] count = 1 while count < num if num % count == 0 primes << count end count += 1 end p primes prime_factors = [] primes.each do |x| if check_prime(x) prime_factors << x end end p prime_factors end prime_factors(13195)