Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include Math
- class Fixnum
- def factor(num=nil)
- return [] if self == 1
- factor = Range.new(num || 2,self/2).select {|x| self % x == 0}.push(self).unshift(1)
- end
- end
- divisors = 0
- count = 0
- puts (1..(1.0/0.0)).find { |x| x.factor.size > 500}.factor
Advertisement
Add Comment
Please, Sign In to add comment