Project Euler problems in Ruby