Solution to #7.

matt@agon:~/programming/ruby/project-euler$ time ruby 7.rb
104743

real    0m2.390s
user    0m2.298s
sys     0m0.098s