# This class decomposes an integer into a product of other integers,

# which, when multiplied together give the integer originally

# entered.

class Integer

def factors() (1…self).select { |n| (self % n).zero? }

end

end

puts "Enter an integer: "

int = gets.chomp.to_i.factors

puts “Factorization: #{int}”

If I enter 1234 at the prompt, for example, I get the following result:

Factorization: [1, 2, 617, 1234]

My problem is that I don’t want the number originally entered at the end

of the output. I want the output to look like this:

Factorization: [1, 2, 617]

What am I doing wrong?