solve problems from projecteuler.net in Ruby