Problem 3

Ruby

 1number = 600851475143;
 2i = 2;
 3max_divisor = 0;
 4loop do
 5    if i > Integer.sqrt(number)
 6        break;
 7    end
 8    if number % i == 0
 9        max_divisor = i;
10        number = number/i;
11        i = 2;
12    else
13        i += 1;
14    end
15end
16puts "#{number}"