Skip to content

Instantly share code, notes, and snippets.

@evizitei
Created January 10, 2012 23:26
Show Gist options
  • Select an option

  • Save evizitei/1591873 to your computer and use it in GitHub Desktop.

Select an option

Save evizitei/1591873 to your computer and use it in GitHub Desktop.
require 'mathn'
n = 600851475143
Prime.each do |x|
while n % x == 0
n = n/x
end
break if x > n/2
end
puts n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment