Posted By

cmm7825 on 05/20/10


Tagged


Versions (?)

Problem 3


 / Published in: Ruby
 

  1. #!/usr/bin/ruby
  2.  
  3. n = 600851475143
  4. while(n > 1)
  5. factor = (2..n).find {|x| n % x == 0}
  6. puts factor
  7. n = n / factor
  8. end

Report this snippet  

You need to login to post a comment.