require 'prime'p Prime.prime_division(600851475143)[-1][0]
Standard input is empty
6857
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!