Solve problems from projecteuler.net in Ruby